3 static inline int myisascii(int x
) {
4 return x
>= ' ' && x
< 127;
7 void dump(const unsigned char* data
, size_t len
) {
8 static const char atab
[] = "0123456789abcdef";
9 char hex
[24*2+1], ascii
[24+1];
10 unsigned h
= 0, a
= 0;
15 hex
[h
++] = atab
[*data
>> 4];
16 hex
[h
++] = atab
[*data
& 0xf];
17 ascii
[a
++] = myisascii(*data
) ? *data
: '.';
22 printf("%s\t%s\n", hex
, ascii
);
24 if(fill
== '_') return; /* jump from filler */