* kern/misc.c (grub_vsprintf): Add `longfmt'. If format string
contains `l' modifier, get a long from va_arg().
+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
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))
}
c = *fmt++;
+ if (c == 'l')
+ {
+ longfmt = 1;
+ c = *fmt++;
+ }
switch (c)
{
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));