[gnome-control-center/gnome-3-14] datetime: Fix "format not a string literal" error



commit 9e0e0df63383154138a9206faf9babb91fcabceb
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Apr 7 14:34:55 2016 +0200

    datetime: Fix "format not a string literal" error
    
    https://bugzilla.gnome.org/show_bug.cgi?id=764727

 panels/datetime/cc-timezone-map.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/panels/datetime/cc-timezone-map.c b/panels/datetime/cc-timezone-map.c
index 85567b2..8b38c9e 100644
--- a/panels/datetime/cc-timezone-map.c
+++ b/panels/datetime/cc-timezone-map.c
@@ -372,7 +372,6 @@ cc_timezone_map_draw (GtkWidget *widget,
   GError *err = NULL;
   gdouble pointx, pointy;
   char buf[16];
-  const char *fmt;
 
   gtk_widget_get_allocation (widget, &alloc);
 
@@ -382,13 +381,19 @@ cc_timezone_map_draw (GtkWidget *widget,
 
   /* paint hilight */
   if (gtk_widget_is_sensitive (widget))
-    fmt = DATETIME_RESOURCE_PATH "/timezone_%s.png";
+    {
+      file = g_strdup_printf (DATETIME_RESOURCE_PATH "/timezone_%s.png",
+                              g_ascii_formatd (buf, sizeof (buf),
+                                               "%g", priv->selected_offset));
+    }
   else
-    fmt = DATETIME_RESOURCE_PATH "/timezone_%s_dim.png";
+    {
+      file = g_strdup_printf (DATETIME_RESOURCE_PATH "/timezone_%s_dim.png",
+                              g_ascii_formatd (buf, sizeof (buf),
+                                               "%g", priv->selected_offset));
+
+    }
 
-  file = g_strdup_printf (fmt,
-                          g_ascii_formatd (buf, sizeof (buf),
-                                           "%g", priv->selected_offset));
   orig_hilight = gdk_pixbuf_new_from_resource (file, &err);
   g_free (file);
   file = NULL;


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