diff options
Diffstat (limited to 'lib/string_helpers.c')
-rw-r--r-- | lib/string_helpers.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/string_helpers.c b/lib/string_helpers.c index 58b78ba57439..0d25f7aa732c 100644 --- a/lib/string_helpers.c +++ b/lib/string_helpers.c @@ -28,11 +28,10 @@ int string_get_size(u64 size, const enum string_size_units units, char *buf, int len) { static const char *const units_10[] = { - "B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB", NULL + "B", "kB", "MB", "GB", "TB", "PB", "EB" }; static const char *const units_2[] = { - "B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB", - NULL + "B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB" }; static const char *const *const units_str[] = { [STRING_UNITS_10] = units_10, @@ -49,7 +48,7 @@ int string_get_size(u64 size, const enum string_size_units units, tmp[0] = '\0'; i = 0; if (size >= divisor[units]) { - while (size >= divisor[units] && units_str[units][i]) { + while (size >= divisor[units]) { remainder = do_div(size, divisor[units]); i++; } |