2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-29 15:28:56 +00:00

dynamic-string: Fix style of ds_put_hex_dump().

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Tested-by: Simon Horman <horms@verge.net.au>
This commit is contained in:
Ben Pfaff
2013-05-15 22:33:11 -07:00
parent a128bd8cbc
commit 9aba74cef5

View File

@@ -361,8 +361,7 @@ ds_put_hex_dump(struct ds *ds, const void *buf_, size_t size,
const uint8_t *buf = buf_;
const size_t per_line = 16; /* Maximum bytes per line. */
while (size > 0)
{
while (size > 0) {
size_t start, end, n;
size_t i;
@@ -375,13 +374,14 @@ ds_put_hex_dump(struct ds *ds, const void *buf_, size_t size,
/* Print line. */
ds_put_format(ds, "%08jx ", (uintmax_t) ROUND_DOWN(ofs, per_line));
for (i = 0; i < start; i++)
for (i = 0; i < start; i++) {
ds_put_format(ds, " ");
for (; i < end; i++)
}
for (; i < end; i++) {
ds_put_format(ds, "%02hhx%c",
buf[i - start], i == per_line / 2 - 1? '-' : ' ');
if (ascii)
{
}
if (ascii) {
for (; i < per_line; i++)
ds_put_format(ds, " ");
ds_put_format(ds, "|");