[Top][All Lists]
[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
- [PATCH 0/5] more var-type-dialog improvements, Ben Pfaff, 2012/07/17
- [PATCH 1/5] var-type-dialog: Avoid string copy setting up currency treeview.,
Ben Pfaff <=
- [PATCH 2/5] var-type-dialog: Fix possible memory leaks., Ben Pfaff, 2012/07/17
- [PATCH 4/5] format: Make fmt_date_template() human-friendly, respect field width., Ben Pfaff, 2012/07/17
- [PATCH 5/5] var-type-dialog: Use fmt_date_template() to reduce duplication., Ben Pfaff, 2012/07/17
- [PATCH 3/5] var-type-dialog: Use G_TYPE_INT to store an int., Ben Pfaff, 2012/07/17
- Re: [PATCH 0/5] more var-type-dialog improvements, John Darrington, 2012/07/17