fix erroneous lowercasing by bb_hexdigits_upcase[i] | 0x10
authorDenis Vlasenko <vda.linux@googlemail.com>
Sun, 18 Mar 2007 17:56:43 +0000 (17:56 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Sun, 18 Mar 2007 17:56:43 +0000 (17:56 -0000)
include/libbb.h
libbb/xfuncs.c

index 30d3006ade5a978c8eb526298afce9ba1a276995..8ad92263e3f580464c380f54f0e48019db208e14 100644 (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[];
index c059e41e05cc32d0feab5c73745c233c618e61d5..ed356a3cc40e887be812c44db3e61ce35b22e3fb 100644 (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;