Description: Fix build failure with -Wformat-security.
From:
 Ilya Barygin <randomaction@ubuntu.com>
 Alessio Treglia <alessio@debian.org>
Reviewed-by: Alessio Treglia <alessio@debian.org>
Last-Update: 2012-11-06
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=647040
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=665097
Forwarded: Tim Janik <tim.janik@googlemail.com>
---
 bse/bseconstant.cc   |    6 +++---
 bse/bsecxxvalue.cc   |    4 ++--
 bse/bsedatapocket.cc |    2 +-
 bse/bseitem.cc       |    2 +-
 bse/bsejanitor.cc    |    6 +++---
 bse/bsemain.cc       |    4 ++--
 bse/bsestorage.c     |    2 +-
 bse/bsetrack.c       |    2 +-
 sfi/sfidl-parser.cc  |    2 +-
 tools/magictest.cc   |    4 ++--
 10 files changed, 17 insertions(+), 17 deletions(-)

--- beast.orig/sfi/sfidl-parser.cc
+++ beast/sfi/sfidl-parser.cc
@@ -238,7 +238,7 @@ Type Parser::typeOf (const String& type)
   if (isSequence (type))      return SEQUENCE;
   if (isRecord (type))	      return RECORD;
   if (isClass (type))	      return OBJECT;
-  g_error (("invalid type: " + type).c_str());
+  g_error ("%s", ("invalid type: " + type).c_str());
   return VOID;
 }
 
--- beast.orig/bse/bsemain.cc
+++ beast/bse/bsemain.cc
@@ -267,9 +267,9 @@ bse_init_core (void)
   /* dump device list */
   if (bse_main_args->dump_driver_list)
     {
-      g_printerr (_("\nAvailable PCM drivers:\n"));
+      g_printerr ("%s", _("\nAvailable PCM drivers:\n"));
       bse_device_dump_list (BSE_TYPE_PCM_DEVICE, "  ", TRUE, NULL, NULL);
-      g_printerr (_("\nAvailable MIDI drivers:\n"));
+      g_printerr ("%s", _("\nAvailable MIDI drivers:\n"));
       bse_device_dump_list (BSE_TYPE_MIDI_DEVICE, "  ", TRUE, NULL, NULL);
     }
 }
--- beast.orig/bse/bsecxxvalue.cc
+++ beast/bse/bsecxxvalue.cc
@@ -56,9 +56,9 @@ Value::get_string () const
 {
   GValue *v = gvalue();
   if (SFI_VALUE_HOLDS_STRING (v))
-    return sfi_value_get_string (v);
+    return (const SfiString) sfi_value_get_string (v);
   else if (SFI_VALUE_HOLDS_CHOICE (v))
-    return sfi_value_get_choice (v);
+    return (const SfiString) sfi_value_get_choice (v);
   else
     throw WrongTypeGValue (G_STRLOC);
 }
--- beast.orig/bse/bseconstant.cc
+++ beast/bse/bseconstant.cc
@@ -105,7 +105,7 @@ bse_constant_class_init (BseConstantClas
       gchar *ident, *label, *blurb, *group = g_strdup_printf (_("Constant Output %u"), i);
       
       ident = g_strdup_printf ("value_%u", i);
-      label = g_strdup_printf (_("Value [float]"));
+      label = g_strdup_printf ("%s", _("Value [float]"));
       bse_object_class_add_param (object_class, group, PARAM_VALUE + (i - 1) * 3,
 				  sfi_pspec_real (ident, label, _("Constant signal value"),
 						  1.0, -1.0, 1.0, 0.01,
@@ -113,7 +113,7 @@ bse_constant_class_init (BseConstantClas
       g_free (ident);
       g_free (label);
       ident = g_strdup_printf ("frequency_%u", i);
-      label = g_strdup_printf (_("Frequency"));
+      label = g_strdup_printf ("%s", _("Frequency"));
       bse_object_class_add_param (object_class, group, PARAM_FREQ + (i - 1) * 3,
 				  sfi_pspec_log_scale (ident, label, _("Constant signal value interpreted as frequency value in Hertz"),
 						       BSE_MAX_FREQUENCY,
@@ -124,7 +124,7 @@ bse_constant_class_init (BseConstantClas
       g_free (ident);
       g_free (label);
       ident = g_strdup_printf ("note_%u", i);
-      label = g_strdup_printf (_("Note"));
+      label = g_strdup_printf ("%s", _("Note"));
       bse_object_class_add_param (object_class, group, PARAM_NOTE + (i - 1) * 3,
 				  sfi_pspec_note (ident, label, _("Constant signal value as note, converted to Hertz according to the current musical tuning"),
 						  SFI_KAMMER_NOTE, SFI_MIN_NOTE, SFI_MAX_NOTE,
--- beast.orig/bse/bsedatapocket.cc
+++ beast/bse/bsedatapocket.cc
@@ -552,7 +552,7 @@ object_entry_resolved (void           *d
   BseDataPocket *pocket = BSE_DATA_POCKET (from_item);
   
   if (error)
-    bse_storage_warn (storage, error);
+    bse_storage_warn (storage, "%s", error);
   else if (oentry->id)
     {
       BseDataPocketValue value;
--- beast.orig/bse/bsestorage.c
+++ beast/bse/bsestorage.c
@@ -601,7 +601,7 @@ item_link_resolved (gpointer     data,
                     const gchar *error)
 {
   if (error)
-    bse_storage_warn (self, error);
+    bse_storage_warn (self, "%s", error);
   else
     {
       GParamSpec *pspec = data;
--- beast.orig/bse/bsetrack.c
+++ beast/bse/bsetrack.c
@@ -939,7 +939,7 @@ part_link_resolved (gpointer        data
   BseTrack *self = BSE_TRACK (from_item);
 
   if (error)
-    bse_storage_warn (storage, error);
+    bse_storage_warn (storage, "%s", error);
   else if (!BSE_IS_PART (to_item))
     bse_storage_warn (storage, "skipping invalid part reference: %s", bse_object_debug_name (to_item));
   else if (to_item->parent != from_item->parent)
--- beast.orig/bse/bseitem.cc
+++ beast/bse/bseitem.cc
@@ -885,7 +885,7 @@ undo_call_proc (BseUndoStep  *ustep,
     {
       const char *packed_item_pointer = g_value_get_string (ivalues + 0);
       BseItem *item = (BseItem*) bse_undo_pointer_unpack (packed_item_pointer, ustack);
-      BseUndoStack *redo_stack = (BseUndoStack*) bse_item_undo_open (item, BSE_PROCEDURE_NAME (proc));
+      BseUndoStack *redo_stack = (BseUndoStack*) bse_item_undo_open (item, "%s", BSE_PROCEDURE_NAME (proc));
       BseUndoStep *redo_step;
       redo_step = bse_undo_step_new (undo_call_proc, unde_free_proc, 3);
       redo_step->data[0].v_pointer = proc;
--- beast.orig/bse/bsejanitor.cc
+++ beast/bse/bsejanitor.cc
@@ -532,9 +532,9 @@ janitor_idle_clean_jsource (void *data)
     {
       self->exit_code = 256; /* exit code used for signals */
       if (port->exit_signal_sent && port->sigkill_sent)
-        self->exit_reason = g_strdup_printf (_("killed by janitor"));
+        self->exit_reason = g_strdup_printf ("%s", _("killed by janitor"));
       else if (port->exit_signal_sent && port->sigterm_sent)
-        self->exit_reason = g_strdup_printf (_("connection terminated"));
+        self->exit_reason = g_strdup_printf ("%s", _("connection terminated"));
       else if (port->exit_signal && port->dumped_core)
         self->exit_reason = g_strdup_printf (_("%s (core dumped)"), g_strsignal (port->exit_signal));
       else if (port->exit_signal)
@@ -560,7 +560,7 @@ janitor_idle_clean_jsource (void *data)
     {
       /* not a janitor for a remote process */
       self->exit_code = -256;
-      self->exit_reason = g_strdup_printf ("unknown intern termination");
+      self->exit_reason = g_strdup_printf ("%s", "unknown intern termination");
     }
   sfi_com_port_unref (port);
   self->port = NULL;
--- beast.orig/tools/magictest.cc
+++ beast/tools/magictest.cc
@@ -92,10 +92,10 @@ main (gint   argc,
 	  
 	  g_print ("%s:", argv[i]);
 	  pad = g_strnfill (MAX (40, l) - l, ' ');
-	  g_print (pad);
+	  g_print ("%s", pad);
 	  g_free (pad);
 	  if (!magic && !loader)
-	    g_print (" no magic/loader found");
+	    g_print ("%s", " no magic/loader found");
 	  else
 	    {
 	      if (magic)
