var-type-dialog: Avoid string copy setting up currency treeview.
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 17 Jul 2012 05:20:42 +0000 (22:20 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 17 Jul 2012 14:09:57 +0000 (07:09 -0700)
The return value of fmt_name() is perfectly suitable here.

src/ui/gui/var-type-dialog.c

index 21d49669de6cc6c858b1b5ddebef7848ee9944fb..786b0c42174fb236a9e822df1f57b016ccc996b2 100644 (file)
@@ -502,11 +502,9 @@ var_type_dialog_create (GtkWindow *toplevel)
   for ( i = 0 ; i < 5 ; ++i )
     {
       enum fmt_type cc_fmts[5] = {FMT_CCA, FMT_CCB, FMT_CCC, FMT_CCD, FMT_CCE};
-      gchar text[4];
-      g_snprintf (text, 4, "%s", fmt_name (cc_fmts[i]));
       gtk_list_store_append (list_store, &iter);
       gtk_list_store_set (list_store, &iter,
-                          0, text,
+                          0, fmt_name (cc_fmts[i]),
                          1, &cc_format[i],
                          -1);
     }