9#ifndef SQUID_LIBNTLMAUTH_SUPPORT_BITS_CCI
10#define SQUID_LIBNTLMAUTH_SUPPORT_BITS_CCI
55 unsigned char *p = data;
58 char bytestr[4] = {0};
59 char addrstr[10] = {0};
60 char hexstr[16 * 3 + 5] = {0};
61 char charstr[16 * 1 + 5] = {0};
62 for (n = 1; n <=
size; ++n) {
65 snprintf(addrstr,
sizeof(addrstr),
"%.4x", (
int) (p - data));
72 snprintf(bytestr,
sizeof(bytestr),
"%02X ", *p);
73 strncat(hexstr, bytestr,
sizeof(hexstr) - strlen(hexstr) - 1);
76 snprintf(bytestr,
sizeof(bytestr),
"%c", c);
77 strncat(charstr, bytestr,
sizeof(charstr) - strlen(charstr) - 1);
81 fprintf(stderr,
"[%4.4s] %-50.50s %s\n", addrstr, hexstr, charstr);
84 }
else if (n % 8 == 0) {
86 strncat(hexstr,
" ",
sizeof(hexstr) - strlen(hexstr) - 1);
87 strncat(charstr,
" ",
sizeof(charstr) - strlen(charstr) - 1);
92 if (strlen(hexstr) > 0) {
94 fprintf(stderr,
"[%4.4s] %-50.50s %s\n", addrstr, hexstr, charstr);
void hex_dump(unsigned char *data, int size)