Fix hexdump for non-printable characters
This commit is contained in:
parent
ba18ada0ae
commit
bb14becb75
9
sort.c
9
sort.c
@ -153,11 +153,18 @@ hexdump(uint8_t *buf, size_t size)
|
|||||||
|
|
||||||
for(j=0; j<16; j++)
|
for(j=0; j<16; j++)
|
||||||
{
|
{
|
||||||
if(i+j < size && isprint(buf[i+j]))
|
if(i+j < size)
|
||||||
|
{
|
||||||
|
if(isprint(buf[i+j]))
|
||||||
fprintf(stderr, "%c", buf[i+j]);
|
fprintf(stderr, "%c", buf[i+j]);
|
||||||
else
|
else
|
||||||
|
fprintf(stderr, ".");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
fprintf(stderr, " ");
|
fprintf(stderr, " ");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user