util/hexdump_line: fix space padding
This commit is contained in:
parent
6ac9d9b325
commit
0a47025c19
7
util.c
7
util.c
@ -59,9 +59,10 @@ hexdump_line(char *buf, const uint8_t *blob, size_t len, size_t off, int pad)
|
|||||||
buflen -= w;
|
buflen -= w;
|
||||||
}
|
}
|
||||||
if (i < 8) {
|
if (i < 8) {
|
||||||
memset(bufp, ' ', 3 * (16 - i));
|
memset(bufp, ' ', 3 * (8 - i));
|
||||||
bufp += 3 * (16 - i);
|
bufp += 3 * (8 - i);
|
||||||
buflen -= 3 * (16 - i);
|
buflen -= 3 * (8 - i);
|
||||||
|
i = 8;
|
||||||
}
|
}
|
||||||
for (; i < len && i < 16; i++) {
|
for (; i < len && i < 16; i++) {
|
||||||
w = snprintf(bufp, buflen, " %02x", blob[i]);
|
w = snprintf(bufp, buflen, " %02x", blob[i]);
|
||||||
|
Loading…
Reference in New Issue
Block a user