From 91bb4f44a4666eb0c3470a0c9041358d0cc47059 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Mon, 18 Nov 2013 12:41:03 +0100 Subject: [PATCH] Wrong string assignment in GtkFormKey::get_sql. --- libgtkform/key.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; } /** -- 2.49.0