diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/hexdump.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/hexdump.c b/lib/hexdump.c index 270773b91923..a61cb6b1f011 100644 --- a/lib/hexdump.c +++ b/lib/hexdump.c | |||
@@ -126,7 +126,7 @@ void hex_dump_to_buffer(const void *buf, size_t len, int rowsize, | |||
126 | lx += scnprintf(linebuf + lx, linebuflen - lx, | 126 | lx += scnprintf(linebuf + lx, linebuflen - lx, |
127 | "%s%16.16llx", j ? " " : "", | 127 | "%s%16.16llx", j ? " " : "", |
128 | (unsigned long long)*(ptr8 + j)); | 128 | (unsigned long long)*(ptr8 + j)); |
129 | ascii_column = 17 * ngroups + 2; | 129 | ascii_column = rowsize * 2 + rowsize / 8 + 2; |
130 | break; | 130 | break; |
131 | } | 131 | } |
132 | 132 | ||
@@ -137,7 +137,7 @@ void hex_dump_to_buffer(const void *buf, size_t len, int rowsize, | |||
137 | for (j = 0; j < ngroups; j++) | 137 | for (j = 0; j < ngroups; j++) |
138 | lx += scnprintf(linebuf + lx, linebuflen - lx, | 138 | lx += scnprintf(linebuf + lx, linebuflen - lx, |
139 | "%s%8.8x", j ? " " : "", *(ptr4 + j)); | 139 | "%s%8.8x", j ? " " : "", *(ptr4 + j)); |
140 | ascii_column = 9 * ngroups + 2; | 140 | ascii_column = rowsize * 2 + rowsize / 4 + 2; |
141 | break; | 141 | break; |
142 | } | 142 | } |
143 | 143 | ||
@@ -148,7 +148,7 @@ void hex_dump_to_buffer(const void *buf, size_t len, int rowsize, | |||
148 | for (j = 0; j < ngroups; j++) | 148 | for (j = 0; j < ngroups; j++) |
149 | lx += scnprintf(linebuf + lx, linebuflen - lx, | 149 | lx += scnprintf(linebuf + lx, linebuflen - lx, |
150 | "%s%4.4x", j ? " " : "", *(ptr2 + j)); | 150 | "%s%4.4x", j ? " " : "", *(ptr2 + j)); |
151 | ascii_column = 5 * ngroups + 2; | 151 | ascii_column = rowsize * 2 + rowsize / 2 + 2; |
152 | break; | 152 | break; |
153 | } | 153 | } |
154 | 154 | ||