]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2005-06-23 Hollis Blanchard <hollis@penguinppc.org>
authorhollisb <hollisb@localhost>
Thu, 23 Jun 2005 23:13:57 +0000 (23:13 +0000)
committerhollisb <hollisb@localhost>
Thu, 23 Jun 2005 23:13:57 +0000 (23:13 +0000)
* kern/misc.c (grub_vsprintf): Add `longfmt'.  If format string
contains `l' modifier, get a long from va_arg().

ChangeLog
kern/misc.c

index 1f5f80d74785a4042d734dd57994e3d66da71ffe..f3bc9dddf6895b182544a9400fb1e39afef6779c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-06-23  Hollis Blanchard  <hollis@penguinppc.org>
+
+       * kern/misc.c (grub_vsprintf): Add `longfmt'.  If format string
+       contains `l' modifier, get a long from va_arg().
+
 2005-06-23  Yoshinori K. Okuji  <okuji@enbug.org>
 
        * kern/mm.c (grub_free): If the next free block which is being
index 524f8cdb444e9739ebe9546f447fc650dddb054a..08e03711baef13de707136842939fd710180cd53 100644 (file)
@@ -562,13 +562,14 @@ grub_vsprintf (char *str, const char *fmt, va_list args)
          char zerofill = ' ';
          int rightfill = 0;
          int n;
-         
+         int longfmt = 0;
+
          if (*fmt && *fmt =='-')
            {
              rightfill = 1;
              fmt++;
            }
-         
+
          p = (char *) fmt;
          /* Read formatting parameters.  */
          while (*p && grub_isdigit (*p))
@@ -600,6 +601,11 @@ grub_vsprintf (char *str, const char *fmt, va_list args)
            }
 
          c = *fmt++;
+         if (c == 'l')
+           {
+             longfmt = 1;
+             c = *fmt++;
+           }
 
          switch (c)
            {
@@ -610,7 +616,10 @@ grub_vsprintf (char *str, const char *fmt, va_list args)
            case 'x':
            case 'u':
            case 'd':
-             n = va_arg (args, int);
+             if (longfmt)
+               n = va_arg (args, long);
+             else
+               n = va_arg (args, int);
              grub_itoa (tmp, c, n);
              if (!rightfill && grub_strlen (tmp) < format1)
                write_fill (zerofill, format1 - grub_strlen (tmp));