From: Andrea Zagli Date: Mon, 18 Nov 2013 11:41:03 +0000 (+0100) Subject: Wrong string assignment in GtkFormKey::get_sql. X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=91bb4f44a4666eb0c3470a0c9041358d0cc47059;p=libgtkform Wrong string assignment in GtkFormKey::get_sql. --- diff --git a/libgtkform/key.c b/libgtkform/key.c index a10eafb..9ab54de 100644 --- a/libgtkform/key.c +++ b/libgtkform/key.c @@ -229,6 +229,7 @@ gchar { GtkFormField *field; GString *sql; + gchar *ret; GtkFormKeyPrivate *priv; GSList *fields; @@ -252,10 +253,12 @@ gchar if (g_strcmp0 (sql->str, "") != 0) { g_string_erase (sql, 0, 5); - g_string_printf (sql, " WHERE %s", sql->str); + g_string_prepend (sql, " WHERE "); } - return sql->str; + ret = g_strdup (sql->str); + g_string_free (sql, TRUE); + return ret; } /**