All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Compiler warning in grub_cmdline_get
@ 2009-08-26 23:55 Colin Watson
  2009-08-28 12:48 ` Robert Millan
  0 siblings, 1 reply; 3+ messages in thread
From: Colin Watson @ 2009-08-26 23:55 UTC (permalink / raw)
  To: grub-devel

I don't think this can actually cause a real problem, but it's a
compiler warning since it might (e.g. if prompt ever contained "%").

  /home/cjwatson/src/ubuntu/grub2/tmp/grub2-1.96+20090826/normal/cmdline.c: In function ‘grub_cmdline_get’:
  /home/cjwatson/src/ubuntu/grub2/tmp/grub2-1.96+20090826/normal/cmdline.c:276: warning: format not a string literal and no format arguments

2009-08-27  Colin Watson  <cjwatson@ubuntu.com>

	* normal/cmdline.c (grub_cmdline_get): Supply a format string as
	the first argument to grub_printf.

Index: normal/cmdline.c
===================================================================
--- normal/cmdline.c	(revision 2535)
+++ normal/cmdline.c	(working copy)
@@ -273,7 +273,7 @@
   if ((grub_getxy () >> 8) != 0)
     grub_putchar ('\n');
 
-  grub_printf (prompt);
+  grub_printf ("%s", prompt);
 
   xpos = plen;
   ystart = ypos = (grub_getxy () & 0xFF);

-- 
Colin Watson                                       [cjwatson@ubuntu.com]



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Compiler warning in grub_cmdline_get
  2009-08-26 23:55 [PATCH] Compiler warning in grub_cmdline_get Colin Watson
@ 2009-08-28 12:48 ` Robert Millan
  2009-08-28 13:25   ` Colin Watson
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Millan @ 2009-08-28 12:48 UTC (permalink / raw)
  To: grub-devel

On Thu, Aug 27, 2009 at 12:55:18AM +0100, Colin Watson wrote:
> I don't think this can actually cause a real problem, but it's a
> compiler warning since it might (e.g. if prompt ever contained "%").
> 
>   /home/cjwatson/src/ubuntu/grub2/tmp/grub2-1.96+20090826/normal/cmdline.c: In function ‘grub_cmdline_get’:
>   /home/cjwatson/src/ubuntu/grub2/tmp/grub2-1.96+20090826/normal/cmdline.c:276: warning: format not a string literal and no format arguments
> 
> 2009-08-27  Colin Watson  <cjwatson@ubuntu.com>
> 
> 	* normal/cmdline.c (grub_cmdline_get): Supply a format string as
> 	the first argument to grub_printf.

Thanks Colin.  For obvious fixes like this one, feel free to commit them
right away.

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Compiler warning in grub_cmdline_get
  2009-08-28 12:48 ` Robert Millan
@ 2009-08-28 13:25   ` Colin Watson
  0 siblings, 0 replies; 3+ messages in thread
From: Colin Watson @ 2009-08-28 13:25 UTC (permalink / raw)
  To: The development of GRUB 2

On Fri, Aug 28, 2009 at 02:48:45PM +0200, Robert Millan wrote:
> On Thu, Aug 27, 2009 at 12:55:18AM +0100, Colin Watson wrote:
> > 2009-08-27  Colin Watson  <cjwatson@ubuntu.com>
> > 
> > 	* normal/cmdline.c (grub_cmdline_get): Supply a format string as
> > 	the first argument to grub_printf.
> 
> Thanks Colin.  For obvious fixes like this one, feel free to commit them
> right away.

OK, done.

-- 
Colin Watson                                       [cjwatson@ubuntu.com]



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-08-28 13:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-26 23:55 [PATCH] Compiler warning in grub_cmdline_get Colin Watson
2009-08-28 12:48 ` Robert Millan
2009-08-28 13:25   ` Colin Watson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.