From 45601d39a23bc7fc3402cf1ea0201a3fa182854d Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 22 Dec 2014 15:10:20 +0100 Subject: [PATCH] Use d_ngettext() in printf format directly .. instead of going via an intermediate variable. This way, gcc is smart enough to detect that the format string is indeed static and not throw a warning. --- src/gcal-month-view.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c index bddaf0bc..24897d19 100644 --- a/src/gcal-month-view.c +++ b/src/gcal-month-view.c @@ -1207,15 +1207,14 @@ gcal_month_view_draw (GtkWidget *widget, GList *l; PangoLayout *overflow_layout; PangoFontDescription *ofont_desc; - const gchar *format; gchar *overflow_str; gdouble y_value; l = g_hash_table_lookup (priv->overflow_cells, GINT_TO_POINTER (i)); /* TODO: Warning in some languages this string can be too long and may overlap wit the number */ - format = g_dngettext (GETTEXT_PACKAGE, "Other event", "Other %d events", g_list_length (l)); - overflow_str = g_strdup_printf (format, g_list_length (l)); + overflow_str = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "Other event", "Other %d events", g_list_length (l)), + g_list_length (l)); gtk_style_context_save (context); gtk_style_context_add_class (context, "overflow");