summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index 44a5dc6d..335c9cb7 100644
--- a/utils.c
+++ b/utils.c
@@ -792,6 +792,8 @@ char *pretty_sizes(u64 size)
size /= 1024;
num_divs++;
}
+ if (num_divs == 0)
+ num_divs = 1;
if (num_divs > ARRAY_SIZE(size_strs))
return NULL;