Fix the pretty print code for num_bytes == 0

master
Chris Mason 2008-05-12 13:01:57 -04:00 committed by David Woodhouse
parent a62332eeb2
commit d160150c8b
1 changed files with 2 additions and 0 deletions

View File

@ -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;