diff options
author | Koen Kooi <koen@openembedded.org> | 2007-06-13 10:30:07 +0000 |
---|---|---|
committer | Koen Kooi <koen@openembedded.org> | 2007-06-13 10:30:07 +0000 |
commit | 17e73f44c043e98722fb0220457cbc845b95fc37 (patch) | |
tree | 05ac66bc8f4b852b8ff697d4f401b3b747ca6f7d /packages/uboot/u-boot-mkimage-gta01-native/uboot-strtoul.patch | |
parent | 21b6863a4b2d6ed5bd11949de415b817057303e6 (diff) |
u-boot-mkimage-gta01-native: add a static git tag and put patches in OE to stop breakage
Diffstat (limited to 'packages/uboot/u-boot-mkimage-gta01-native/uboot-strtoul.patch')
-rw-r--r-- | packages/uboot/u-boot-mkimage-gta01-native/uboot-strtoul.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/packages/uboot/u-boot-mkimage-gta01-native/uboot-strtoul.patch b/packages/uboot/u-boot-mkimage-gta01-native/uboot-strtoul.patch new file mode 100644 index 0000000000..a88e94b006 --- /dev/null +++ b/packages/uboot/u-boot-mkimage-gta01-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++; + } |