From: Andrea Zagli Date: Sat, 30 Jan 2016 15:45:25 +0000 (+0100) Subject: Littles adjustments to code. X-Git-Tag: v0.1.0~3^2~18 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=b43f61f6eb36e850f39ac2b79f44e3f9d3cea8f3;p=libzakcgi Littles adjustments to code. --- diff --git a/src/form.c b/src/form.c index 9877658..8cc1b52 100644 --- a/src/form.c +++ b/src/form.c @@ -145,7 +145,7 @@ zak_cgi_form_bind (ZakCgiForm *zakcgiform) priv = ZAK_CGI_FORM_GET_PRIVATE (zakcgiform); - for (i == 0; i < priv->ar_elems->len; i++) + for (i = 0; i < priv->ar_elems->len; i++) { ZakCgiFormElement *element = (ZakCgiFormElement *)g_ptr_array_index (priv->ar_elems, i); if (!ZAK_CGI_IS_FORM_ELEMENT_STRING (element)) @@ -214,7 +214,7 @@ gchar g_string_append (str, tmp); g_free (tmp); - for (i == 0; i < priv->ar_elems->len; i++) + for (i = 0; i < priv->ar_elems->len; i++) { ZakCgiFormElement *element = (ZakCgiFormElement *)g_ptr_array_index (priv->ar_elems, i); tmp = zak_cgi_form_element_render (element); diff --git a/tests/form.c b/tests/form.c index 9cb2fed..33e2c09 100644 --- a/tests/form.c +++ b/tests/form.c @@ -41,7 +41,7 @@ main (int argc, char *argv[]) ZakCgiForm *form; ZakCgiFormElement *element; - ZakFormElementValidator *validator; + ZakFormElementValidatorRegex *validator; zakcgimain = zak_cgi_main_new (); @@ -69,8 +69,8 @@ main (int argc, char *argv[]) zak_form_element_add_filter (ZAK_FORM_ELEMENT (element), ZAK_FORM_ELEMENT_FILTER (zak_form_element_filter_trim_new ())); validator = zak_form_element_validator_regex_new (); - zak_form_element_validator_regex_set_regex (ZAK_FORM_ELEMENT_VALIDATOR_REGEX (validator), "^aaa$"); - zak_form_element_add_validator (ZAK_FORM_ELEMENT (element), validator); + zak_form_element_validator_regex_set_regex (validator, "^aaa$"); + zak_form_element_add_validator (ZAK_FORM_ELEMENT (element), ZAK_FORM_ELEMENT_VALIDATOR (validator)); zak_form_form_add_element (ZAK_FORM_FORM (form), ZAK_FORM_ELEMENT (element)); element = zak_cgi_form_element_check_new_attrs ("chk", NULL);