summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-29 14:26:56 +0100
committerLeah Rowe <leah@libreboot.org>2026-03-29 14:26:56 +0100
commite4016eb32c6fce3b3507de16961e8d60907f6776 (patch)
treede074783bce03a41f0871f7ba27141105aa76f6a /util
parentac04a5f50abdbf241d14bce845051051eb80b137 (diff)
lbutils hexdump: reduce width on smaller integers
showing the size for 64-bit high integers seems silly Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util')
-rw-r--r--util/libreboot-utils/lib/num.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/util/libreboot-utils/lib/num.c b/util/libreboot-utils/lib/num.c
index bf4afaef..e13a8853 100644
--- a/util/libreboot-utils/lib/num.c
+++ b/util/libreboot-utils/lib/num.c
@@ -80,7 +80,10 @@ spew_hex(const void *data, size_t len)
for (i = 0; i < len; i += 16) {
- printf("%0*zx ", sizeof(size_t) * 2, i);
+ if (len <= 4294967296) /* below 4GB */
+ printf("%08zx ", i);
+ else
+ printf("%0*zx ", sizeof(size_t) * 2, i);
for (j = 0; j < 16; j++) {