diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-26 23:31:05 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-26 23:31:05 +0000 |
commit | 98c0bba09d326624740a120173dbd28fbed2da22 (patch) | |
tree | 1e1682b33073c2afd28d210b01c7179776146356 | |
parent | fc7f92253ae1c4f050e5ea2322b53b0e81bf96be (diff) | |
download | busybox-w32-98c0bba09d326624740a120173dbd28fbed2da22.tar.gz busybox-w32-98c0bba09d326624740a120173dbd28fbed2da22.tar.bz2 busybox-w32-98c0bba09d326624740a120173dbd28fbed2da22.zip |
fix bin2hex bug. lowercase = uppercase | 0x20, not | 0x10!
-rw-r--r-- | include/libbb.h | 2 | ||||
-rw-r--r-- | libbb/xfuncs.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/libbb.h b/include/libbb.h index d2da056f7..8b9842344 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -739,7 +739,7 @@ extern const char bb_msg_standard_input[]; | |||
739 | extern const char bb_msg_standard_output[]; | 739 | extern const char bb_msg_standard_output[]; |
740 | 740 | ||
741 | extern const char bb_str_default[]; | 741 | extern const char bb_str_default[]; |
742 | /* NB: (bb_hexdigits_upcase[i] | 0x10) -> lowercase hex digit */ | 742 | /* NB: (bb_hexdigits_upcase[i] | 0x20) -> lowercase hex digit */ |
743 | extern const char bb_hexdigits_upcase[]; | 743 | extern const char bb_hexdigits_upcase[]; |
744 | 744 | ||
745 | extern const char bb_path_mtab_file[]; | 745 | extern const char bb_path_mtab_file[]; |
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c index f6b904f78..4d85b1181 100644 --- a/libbb/xfuncs.c +++ b/libbb/xfuncs.c | |||
@@ -343,8 +343,8 @@ char *bin2hex(char *p, const char *cp, int count) | |||
343 | while (count) { | 343 | while (count) { |
344 | unsigned char c = *cp++; | 344 | unsigned char c = *cp++; |
345 | /* put lowercase hex digits */ | 345 | /* put lowercase hex digits */ |
346 | *p++ = 0x10 | bb_hexdigits_upcase[c >> 4]; | 346 | *p++ = 0x20 | bb_hexdigits_upcase[c >> 4]; |
347 | *p++ = 0x10 | bb_hexdigits_upcase[c & 0xf]; | 347 | *p++ = 0x20 | bb_hexdigits_upcase[c & 0xf]; |
348 | count--; | 348 | count--; |
349 | } | 349 | } |
350 | return p; | 350 | return p; |