pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/5] var-type-dialog: Avoid string copy setting up currency treev


From: Ben Pfaff
Subject: [PATCH 1/5] var-type-dialog: Avoid string copy setting up currency treeview.
Date: Mon, 16 Jul 2012 23:45:52 -0700

The return value of fmt_name() is perfectly suitable here.
---
 src/ui/gui/var-type-dialog.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/src/ui/gui/var-type-dialog.c b/src/ui/gui/var-type-dialog.c
index 21d4966..786b0c4 100644
--- a/src/ui/gui/var-type-dialog.c
+++ b/src/ui/gui/var-type-dialog.c
@@ -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);
     }
-- 
1.7.2.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]