Skip to contentSkip to conversation

Fix format-security compile warnings/errors

PATCH In review Richard Laager 2 participants 3 messages Feb 1, 2012 – Feb 4, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix format-security compile warnings/errors

The attached trivial patch fixes a couple of format-security warnings/errors (if -Werror=format-security is set, as is becoming more popular on distros).

Signature · 1 line
Richard
util/grub-mkimage.c +1 -1
Index: grub/util/grub-mkimage.c
===================================================================
@@ -1821,7 +1821,7 @@
 
   if (!image_target)
     {
-      printf (_("Target format not specified (use the -O option).\n"));
+      printf ("%s", _("Target format not specified (use the -O option).\n"));
       usage (1);
     }
 
util/grub-mkrelpath.c +1 -1
Index: grub/util/grub-mkrelpath.c
===================================================================
@@ -89,7 +89,7 @@
 
   if (optind >= argc)
     {
-      fprintf (stderr, _("No path is specified.\n"));
+      fprintf (stderr, "%s", _("No path is specified.\n"));
       usage (1);
     }
 
util/grub-probe.c +1 -1
Index: grub/util/grub-probe.c
===================================================================
@@ -746,7 +746,7 @@
   /* Obtain ARGUMENT.  */
   if (optind >= argc)
     {
-      fprintf (stderr, _("No path or device is specified.\n"));
+      fprintf (stderr, "%s", _("No path or device is specified.\n"));
       usage (1);
     }
 
#2 lore raw

You introduced another one of these in revision 3830. Patch attached.

Signature · 1 line
Richard
grub-core/loader/i386/xnu.c +1 -1
Index: grub/grub-core/loader/i386/xnu.c
===================================================================
@@ -1003,7 +1003,7 @@ grub_xnu_boot (void)
 
   if (debug && (grub_strword (debug, "all") || grub_strword (debug, "xnu")))
     {
-      grub_printf (_("Press any key to launch xnu\n"));
+      grub_printf ("%s", _("Press any key to launch xnu\n"));
       grub_getkey ();
     }