]> saetta.ns0.it Git - libgtkform/commitdiff
Wrong string assignment in GtkFormKey::get_sql.
authorAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Mon, 18 Nov 2013 11:41:03 +0000 (12:41 +0100)
committerAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Mon, 18 Nov 2013 11:41:03 +0000 (12:41 +0100)
libgtkform/key.c

index a10eafb453c1e514d40c4a3aed32214b0a14f99a..9ab54de8d88fccfb98447182c5499d45266a5fc0 100644 (file)
@@ -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;
 }
 
 /**