[gnome-commander] master: Make code compile with -Werror=format-security



commit 4eb9419269c19b0469557811141c1c9746899387
Author: Mamoru TASAKA <mtasaka fedoraproject org>
Date:   Fri Dec 27 23:45:42 2013 +0900

    master: Make code compile with -Werror=format-security
    
    Signed-off-by: Uwe Scholz <uwescholz src gnome org>

 libgcmd/libgcmd-widget-factory.cc    |    2 +-
 src/gnome-cmd-prepare-xfer-dialog.cc |    1 +
 src/utils.cc                         |    4 ++--
 src/utils.h                          |    4 ++--
 4 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/libgcmd/libgcmd-widget-factory.cc b/libgcmd/libgcmd-widget-factory.cc
index 53d5796..2111527 100644
--- a/libgcmd/libgcmd-widget-factory.cc
+++ b/libgcmd/libgcmd-widget-factory.cc
@@ -523,7 +523,7 @@ void create_error_dialog (const gchar *msg, ...)
     vsprintf (string, msg, argptr);
     va_end (argptr);
 
-    dialog = gtk_message_dialog_new (GTK_WINDOW (main_win_widget), GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, 
GTK_BUTTONS_OK, string);
+    dialog = gtk_message_dialog_new (GTK_WINDOW (main_win_widget), GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, 
GTK_BUTTONS_OK, "%s", string);
 
     g_signal_connect (dialog, "response", G_CALLBACK (on_response), dialog);
 
diff --git a/src/gnome-cmd-prepare-xfer-dialog.cc b/src/gnome-cmd-prepare-xfer-dialog.cc
index 26bb02a..2b6f035 100644
--- a/src/gnome-cmd-prepare-xfer-dialog.cc
+++ b/src/gnome-cmd-prepare-xfer-dialog.cc
@@ -190,6 +190,7 @@ static void on_ok (GtkButton *button, GnomeCmdPrepareXferDialog *dialog)
                                                             (GtkDialogFlags) 0,
                                                             GTK_MESSAGE_QUESTION,
                                                             GTK_BUTTONS_OK_CANCEL,
+                                                            "%s",
                                                             msg);
                 gint choice = gtk_dialog_run (GTK_DIALOG (dialog));
                 gtk_widget_destroy (dialog);
diff --git a/src/utils.cc b/src/utils.cc
index 4cd31ed..62711ca 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -183,7 +183,7 @@ gint run_simple_dialog (GtkWidget *parent, gboolean ignore_close_box,
     button_titles = convert_varargs_to_name_array (button_title_args);
     va_end (button_title_args);
 
-    dialog = gtk_message_dialog_new_with_markup (*main_win, GTK_DIALOG_MODAL, msg_type, GTK_BUTTONS_NONE, 
text);
+    dialog = gtk_message_dialog_new_with_markup (*main_win, GTK_DIALOG_MODAL, msg_type, GTK_BUTTONS_NONE, 
"%s", text);
     if (title)
         gtk_window_set_title (GTK_WINDOW (dialog), title);
 
@@ -575,7 +575,7 @@ void mime_exec_single (GnomeCmdFile *f)
         else
         {
             gchar *msg = g_strdup_printf (_("%s does not know how to open remote file. Do you want to 
download the file to a temporary location and then open it?"), gnome_cmd_app_get_name (app));
-            GtkWidget *dialog = gtk_message_dialog_new (*main_win, GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, 
GTK_BUTTONS_YES_NO, msg);
+            GtkWidget *dialog = gtk_message_dialog_new (*main_win, GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, 
GTK_BUTTONS_YES_NO, "%s", msg);
             TmpDlData *dldata = g_new0 (TmpDlData, 1);
             args[0] = (gpointer) app;
             // args[2] is NULL here (don't set exec dir for temporarily downloaded files)
diff --git a/src/utils.h b/src/utils.h
index 88e2316..c2559f9 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -259,10 +259,10 @@ gboolean gnome_cmd_prepend_su_to_vector (int &argc, char **&argv);
 
 inline gint gnome_cmd_prompt_message (GtkWindow *parent, GtkMessageType type, GtkButtonsType buttons, const 
gchar *message, const gchar *secondary_text=NULL)
 {
-    GtkWidget *dlg = gtk_message_dialog_new (parent, GTK_DIALOG_DESTROY_WITH_PARENT, type, buttons, message);
+    GtkWidget *dlg = gtk_message_dialog_new (parent, GTK_DIALOG_DESTROY_WITH_PARENT, type, buttons, "%s", 
message);
 
     if (secondary_text)
-        gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dlg), secondary_text);
+        gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dlg), "%s", secondary_text);
 
     gint result = gtk_dialog_run (GTK_DIALOG (dlg));
 


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