fix erroneous lowercasing by bb_hexdigits_upcase[i] | 0x10

1_4_stable
Denis Vlasenko 2007-03-18 17:56:43 +00:00
parent bbbb7e02fc
commit e3d83aafb4
2 changed files with 3 additions and 3 deletions

View File

@ -690,7 +690,7 @@ extern const char bb_msg_standard_input[];
extern const char bb_msg_standard_output[];
extern const char bb_str_default[];
/* NB: (bb_hexdigits_upcase[i] | 0x10) -> lowercase hex digit */
/* NB: (bb_hexdigits_upcase[i] | 0x20) -> lowercase hex digit */
extern const char bb_hexdigits_upcase[];
extern const char bb_path_mtab_file[];

View File

@ -340,8 +340,8 @@ char *bin2hex(char *p, const char *cp, int count)
while (count) {
unsigned char c = *cp++;
/* put lowercase hex digits */
*p++ = 0x10 | bb_hexdigits_upcase[c >> 4];
*p++ = 0x10 | bb_hexdigits_upcase[c & 0xf];
*p++ = 0x20 | bb_hexdigits_upcase[c >> 4];
*p++ = 0x20 | bb_hexdigits_upcase[c & 0xf];
count--;
}
return p;