[gvfs/gnome-3-20] udisks2: Fix "format not a string literal" warnings



commit bcdec26fcd1ac6d1b899c8cb49ee56cdd1b9db3b
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Jun 7 16:34:58 2016 +0200

    udisks2: Fix "format not a string literal" warnings
    
    https://bugzilla.gnome.org/show_bug.cgi?id=767349

 monitor/udisks2/gvfsudisks2utils.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/monitor/udisks2/gvfsudisks2utils.c b/monitor/udisks2/gvfsudisks2utils.c
index 9519a99..71d2b7d 100644
--- a/monitor/udisks2/gvfsudisks2utils.c
+++ b/monitor/udisks2/gvfsudisks2utils.c
@@ -659,7 +659,6 @@ unmount_notify_timer_cb (gpointer user_data)
 {
   UnmountNotifyData *data = user_data;
   gchar *message, *name;
-  const gchar *format;
 
   data->unmount_timer_id = 0;
 
@@ -672,11 +671,11 @@ unmount_notify_timer_cb (gpointer user_data)
   data->unmount_fired = TRUE;
 
   name = unmount_notify_get_name (data);
-  format = data->generic_text ?
-    _("Unmounting %s\nPlease wait") :
-    _("Writing data to %s\nDon't unplug until finished");
+  if (data->generic_text)
+    message = g_strdup_printf (_("Unmounting %s\nPlease wait"), name);
+  else
+    message = g_strdup_printf (_("Writing data to %s\nDon't unplug until finished"), name);
 
-  message = g_strdup_printf (format, name);
   g_signal_emit_by_name (data->op, "show-unmount-progress",
                          message, -1, -1);
   g_free (message);
@@ -805,7 +804,6 @@ gvfs_udisks2_unmount_notify_stop (GMountOperation *op,
                                   gboolean         unmount_failed)
 {
   gchar *message, *name;
-  const gchar *format;
   UnmountNotifyData *data = g_object_get_data (G_OBJECT (op), "x-udisks2-notify-data");
 
   if (data == NULL)
@@ -817,10 +815,11 @@ gvfs_udisks2_unmount_notify_stop (GMountOperation *op,
     return;
 
   name = unmount_notify_get_name (data);
-  format = data->generic_text ?
-    _("%s has been unmounted\n") : _("You can now unplug %s\n");
+  if (data->generic_text)
+    message = g_strdup_printf (_("%s has been unmounted\n"), name);
+  else
+    message = g_strdup_printf (_("You can now unplug %s\n"), name);
 
-  message = g_strdup_printf (format, name);
   g_signal_emit_by_name (data->op, "show-unmount-progress",
                          message, 0, 0);
 


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