From e788ea0d875a4c1fc48b86c6de28cca1d3bf6bf4 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Sun, 30 Apr 2017 11:18:48 +0200 Subject: [PATCH] Now ZakFormElement::messages is always not null. --- src/formelement.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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)); -- 2.49.0