From ef246014604539f6ba36ae7c93d3bb15c7d35104 Mon Sep 17 00:00:00 2001 From: rbuj Date: Thu, 19 Nov 2020 12:02:28 +0100 Subject: math-buttons: Remove warnings about format not a string literal --- src/math-buttons.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/math-buttons.c b/src/math-buttons.c index f9e74f5..a28db23 100644 --- a/src/math-buttons.c +++ b/src/math-buttons.c @@ -902,17 +902,16 @@ shift_left_cb(GtkWidget *widget, MathButtons *buttons) for (i = 1; i < 16; i++) { GtkWidget *item, *label; - gchar *format, *text; + gchar *text; if (i < 10) { /* Left Shift Popup: Menu item to shift left by n places (n < 10) */ - format = ngettext("_%d place", "_%d places", i); + text = g_strdup_printf(ngettext("_%d place", "_%d places", i), i); } else { /* Left Shift Popup: Menu item to shift left by n places (n >= 10) */ - format = ngettext("%d place", "%d places", i); + text = g_strdup_printf(ngettext("%d place", "%d places", i), i); } - text = g_strdup_printf(format, i); label = gtk_label_new_with_mnemonic(text); item = gtk_menu_item_new(); @@ -945,17 +944,16 @@ shift_right_cb(GtkWidget *widget, MathButtons *buttons) for (i = 1; i < 16; i++) { GtkWidget *item, *label; - gchar *format, *text; + gchar *text; if (i < 10) { /* Right Shift Popup: Menu item to shift right by n places (n < 10) */ - format = ngettext("_%d place", "_%d places", i); + text = g_strdup_printf(ngettext("_%d place", "_%d places", i), i); } else { /* Right Shift Popup: Menu item to shift right by n places (n >= 10) */ - format = ngettext("%d place", "%d places", i); + text = g_strdup_printf(ngettext("%d place", "%d places", i), i); } - text = g_strdup_printf(format, i); label = gtk_label_new_with_mnemonic(text); item = gtk_menu_item_new(); -- cgit v1.2.1