diff options
Diffstat (limited to 'src/util.c')
| -rw-r--r-- | src/util.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -200,11 +200,11 @@ int snprintf_units(char *buffer, size_t max, uint64_t bytes, unit_t unit) break; default: { - int i = -1; - do { + int i = 0; + while (round(value) >= base && i < 4) { value /= base; i++; - } while (round(value * 10) / 10 >= base && i < 4); + } const char *units[2][5] = { { " B", " kB", " MB", " GB", " TB" }, |
