From 8cc50345f854b0a83da749adaeb0d83780e6ede6 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 27 Feb 2009 19:33:38 +0000 Subject: [PATCH] 2009-02-27 Robert Millan * kern/misc.c (grub_strtoull): Fix bug (it mistakenly parsed the `0x' qualifier as 0 when base is specified as parameter). --- ChangeLog | 5 +++++ kern/misc.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f1f95f25c..cbf9a414d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-02-27 Robert Millan + + * 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 * configure.ac: Check for -mcmodel=large in x86_64 target. diff --git a/kern/misc.c b/kern/misc.c index 641bd7aef..23eaa14e3 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -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; }