Commit 49952996 authored by Bernhard Nortmann's avatar Bernhard Nortmann
Browse files

fel: Simplify hexdump() single character output, using putchar()


Signed-off-by: default avatarBernhard Nortmann <bernhard.nortmann@web.de>
parent 425278ac
......@@ -317,23 +317,19 @@ void hexdump(void *data, uint32_t offset, size_t size)
size_t i;
printf("%08lx: ",(long int)offset + j);
for (i = 0; i < 16; i++) {
if ((j+i) < size) {
if (j + i < size)
printf("%02x ", buf[j+i]);
} else {
else
printf("__ ");
}
}
printf(" ");
putchar(' ');
for (i = 0; i < 16; i++) {
if (j+i >= size) {
printf(".");
} else if (isprint(buf[j+i])) {
printf("%c", buf[j+i]);
} else {
printf(".");
}
if (j + i >= size)
putchar('.');
else
putchar(isprint(buf[j+i]) ? buf[j+i] : '.');
}
printf("\n");
putchar('\n');
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment