libutil: fix hexdump indentation

The current implementation of util_hexdump_grp() enforces a minimum
indentation of 1 space which may not be suitable for all users.

Fix this by allowing a true zero indentation level.

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
Peter Oberparleiter
2024-02-05 14:40:25 +01:00
committed by Steffen Eiden
parent 8ed478ce46
commit c366429e57

View File

@@ -27,7 +27,7 @@ void util_hexdump_grp(FILE *fh, const char *tag, const void *data, int grp,
for (i = 0; i < count; i++) {
if (first) {
fprintf(fh, "%*s", indent, " ");
fprintf(fh, "%*s", indent, "");
if (tag)
fprintf(fh, "%s: ", tag);
fprintf(fh, "%08x: ", i);