]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Fix failing printf test.
authorColin Watson <cjwatson@ubuntu.com>
Wed, 2 Jan 2013 12:48:31 +0000 (12:48 +0000)
committerColin Watson <cjwatson@ubuntu.com>
Wed, 2 Jan 2013 12:48:31 +0000 (12:48 +0000)
* grub-core/kern/misc.c (grub_vsnprintf_real): Parse '-', '.', and
'$' in the correct order when collecting type information.

ChangeLog
grub-core/kern/misc.c

index 68920bfde1f3a0032008560193ab7fe56b74dfa6..bb263f28118d40ac40b81337ee110f5e2317e9b4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-01-02  Colin Watson  <cjwatson@ubuntu.com>
+
+       Fix failing printf test.
+
+       * grub-core/kern/misc.c (grub_vsnprintf_real): Parse '-', '.', and
+       '$' in the correct order when collecting type information.
+
 2013-01-02  Colin Watson  <cjwatson@ubuntu.com>
 
        * docs/grub.texi (configfile): Explain environment variable
index 95d46245e0d336bb6ada9caaf6cf31fd4cbf7d92..c3203a06823e96e739d4ba43f30540b5443e28ec 100644 (file)
@@ -741,23 +741,26 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, va_list a
       if (*fmt && *fmt =='-')
        fmt++;
 
-      while (*fmt && grub_isdigit (*fmt))
-       fmt++;
-
-      if (*fmt && *fmt =='.')
-       fmt++;
+      p = fmt;
 
       while (*fmt && grub_isdigit (*fmt))
        fmt++;
 
-      p = fmt;
-
       if (*fmt && *fmt == '$')
        {
          curn = grub_strtoull (p, 0, 10) - 1;
          fmt++;
        }
 
+      if (*fmt && *fmt =='-')
+       fmt++;
+
+      while (*fmt && grub_isdigit (*fmt))
+       fmt++;
+
+      if (*fmt && *fmt =='.')
+       fmt++;
+
       while (*fmt && grub_isdigit (*fmt))
        fmt++;