aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usbdump.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/usbdump.c b/usbdump.c
index 84ea108..d747a7e 100644
--- a/usbdump.c
+++ b/usbdump.c
@@ -66,16 +66,12 @@ void hexdump(char *linebuf, void *address, int length)
for (i = 0; i < length && (opt_data_limit == -1 || i < opt_data_limit); i++) {
if (n > LINEBUF_LEN - 4)
continue;
- if (i && !(i & 0x01)) {
- linebuf[n++] = ' ';
- linebuf[n] = '\0';
- }
if (i && !(i & 0x0f)) {
linebuf[n++] = ' ';
linebuf[n] = '\0';
}
- snprintf(linebuf+n, LINEBUF_LEN-n, "%.2x", buf[i]);
- n += 2;
+ snprintf(linebuf+n, LINEBUF_LEN-n, "%.2x ", buf[i]);
+ n += 3;
}
}