[gnome-settings-daemon] wacom: Fix "format not a string literal" error



commit 14dde9201cd940170ee1411fc6d799de3570d659
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Apr 7 15:40:07 2016 +0200

    wacom: Fix "format not a string literal" error
    
    And remove extra argument to the formatting function that we wouldn't
    have been able to catch before.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=764729

 plugins/wacom/gsd-wacom-osd-window.c |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-osd-window.c b/plugins/wacom/gsd-wacom-osd-window.c
index 2bbb91d..d0814b0 100644
--- a/plugins/wacom/gsd-wacom-osd-window.c
+++ b/plugins/wacom/gsd-wacom-osd-window.c
@@ -53,6 +53,17 @@
 
 #define CURSOR_HIDE_TIMEOUT    2 /* seconds */
 
+#define CSS_NORMAL_BUTTON      \
+       "%s.%s {\n"             \
+       "    opacity: %s\n"     \
+       "}\n"
+
+#define CSS_EDITING_BUTTON             \
+       "%s.%s {\n"                     \
+       "    stroke: %s !important;\n"  \
+       "    fill: %s !important;\n"    \
+       "}\n"
+
 static struct {
        const gchar     *color_name;
        const gchar     *color_value;
@@ -847,7 +858,6 @@ gsd_wacom_osd_window_update (GsdWacomOSDWindow *osd_window)
        buttons_section = g_strdup ("");
        for (l = osd_window->priv->buttons; l != NULL; l = l->next) {
                gchar *color_str;
-               const gchar *css;
                GsdWacomOSDButton *osd_button = l->data;
 
                if (osd_button->priv->visible == FALSE)
@@ -855,21 +865,13 @@ gsd_wacom_osd_window_update (GsdWacomOSDWindow *osd_window)
 
                if (osd_window_editing_button (osd_window) &&
                    osd_button != osd_window->priv->current_button) {
-                       css = "%s.%s {\n"
-                               "      opacity: %s\n"
-                               "}\n";
-                       buttons_section = g_strdup_printf (css,
+                       buttons_section = g_strdup_printf (CSS_NORMAL_BUTTON,
                                                           buttons_section,
                                                           osd_button->priv->class,
-                                                          OPACITY_IN_EDITION,
-                                                          NULL);
+                                                          OPACITY_IN_EDITION);
                } else {
                        color_str = gsd_wacom_osd_button_get_color_str (osd_button);
-                       css = "%s.%s {\n"
-                               "      stroke: %s !important;\n"
-                               "      fill: %s !important;\n"
-                               "}\n";
-                       buttons_section = g_strdup_printf (css,
+                       buttons_section = g_strdup_printf (CSS_EDITING_BUTTON,
                                                           buttons_section,
                                                           osd_button->priv->class,
                                                           color_str,


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