2009-02-27 Robert Millan <rmh@aybabtu.com>

* kern/misc.c (grub_strtoull): Fix bug (it mistakenly parsed the
        `0x' qualifier as 0 when base is specified as parameter).
This commit is contained in:
robertmh 2009-02-27 19:33:38 +00:00
parent 6e09b8b72e
commit 8cc50345f8
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2009-02-27 Robert Millan <rmh@aybabtu.com>
* kern/misc.c (grub_strtoull): Fix bug (it mistakenly parsed the
`0x' qualifier as 0 when base is specified as parameter).
2009-02-24 Bean <bean123ch@gmail.com>
* configure.ac: Check for -mcmodel=large in x86_64 target.

View file

@ -438,7 +438,7 @@ grub_strtoull (const char *str, char **end, int base)
/* Guess the base, if not specified. The prefix `0x' means 16, and
the prefix `0' means 8. */
if (base == 0 && str[0] == '0')
if (str[0] == '0')
{
if (str[1] == 'x')
{
@ -448,7 +448,7 @@ grub_strtoull (const char *str, char **end, int base)
str += 2;
}
}
else if (str[1] >= '0' && str[1] <= '7')
else if (base == 0 && str[1] >= '0' && str[1] <= '7')
base = 8;
}