diff options
author | Michael Lauer <mickey@vanille-media.de> | 2007-08-05 06:43:12 +0000 |
---|---|---|
committer | Michael Lauer <mickey@vanille-media.de> | 2007-08-05 06:43:12 +0000 |
commit | 2363582ba077eed1f858893927abfa7d65f78686 (patch) | |
tree | bc25f0cbc5e92c2840da8aee2bab9f2a22d6e417 /packages/uboot/u-boot-mkimage-openmoko-native/uboot-strtoul.patch | |
parent | 33b0859221ec2b755b1e1f9a69c5d19b0c2d824b (diff) | |
parent | 7a792e2f3fd515657da9dc0537a6e32a2cc06180 (diff) |
merge of '192efb6d3bfaa24757749bea21bc0515b1017108'
and 'baf87732958baffc539a6e90858e6c2fe5972a1e'
Diffstat (limited to 'packages/uboot/u-boot-mkimage-openmoko-native/uboot-strtoul.patch')
-rw-r--r-- | packages/uboot/u-boot-mkimage-openmoko-native/uboot-strtoul.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/packages/uboot/u-boot-mkimage-openmoko-native/uboot-strtoul.patch b/packages/uboot/u-boot-mkimage-openmoko-native/uboot-strtoul.patch new file mode 100644 index 0000000000..a88e94b006 --- /dev/null +++ b/packages/uboot/u-boot-mkimage-openmoko-native/uboot-strtoul.patch @@ -0,0 +1,43 @@ +Make simple_strtoul work with upper-case hex numbers. + +Signed-off-by: Harald Welte <laforge@openmoko.org> + +Index: u-boot/lib_generic/vsprintf.c +=================================================================== +--- u-boot.orig/lib_generic/vsprintf.c ++++ u-boot/lib_generic/vsprintf.c +@@ -25,21 +25,22 @@ unsigned long simple_strtoul(const char + { + unsigned long result = 0,value; + +- if (*cp == '0') { +- cp++; +- if ((*cp == 'x') && isxdigit(cp[1])) { +- base = 16; +- cp++; +- } +- if (!base) { +- base = 8; +- } +- } + if (!base) { + base = 10; ++ if (*cp == '0') { ++ base = 8; ++ cp++; ++ if ((toupper(*cp) == 'X') && isxdigit(cp[1])) { ++ cp++; ++ base = 16; ++ } ++ } ++ } else if (base == 16) { ++ if (cp[0] == '0' && toupper(cp[1]) == 'X') ++ cp += 2; + } +- while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp) +- ? toupper(*cp) : *cp)-'A'+10) < base) { ++ while (isxdigit(*cp) && ++ (value = isdigit(*cp) ? *cp-'0' : toupper(*cp)-'A'+10) < base) { + result = result*base + value; + cp++; + } |