From: Andrea Zagli Date: Sun, 30 Apr 2017 09:18:48 +0000 (+0200) Subject: Now ZakFormElement::messages is always not null. X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=e788ea0d875a4c1fc48b86c6de28cca1d3bf6bf4;p=zakform%2Fcgi Now ZakFormElement::messages is always not null. --- diff --git a/src/formelement.c b/src/formelement.c index 47c742a..93d2fb3 100644 --- a/src/formelement.c +++ b/src/formelement.c @@ -166,6 +166,8 @@ gchar gchar *ret; GPtrArray *messages; + guint i; + ZakFormCgiFormElementPrivate *priv; priv = ZAK_FORM_CGI_FORM_ELEMENT_GET_PRIVATE (element); @@ -173,7 +175,8 @@ gchar str = g_string_new ("
len > 0) { g_string_append (str, " has-error"); } @@ -222,12 +225,10 @@ gchar if (messages != NULL) { - guint i; - for (i = 0; i < messages->len; i++) { g_string_append_printf (str, - "\n%s", + "\n%s", priv->id, i + 1, (gchar *)g_ptr_array_index (messages, i));