diff options
author | David Härdeman <david@hardeman.nu> | 2020-06-11 00:09:57 +0200 |
---|---|---|
committer | David Härdeman <david@hardeman.nu> | 2020-06-11 00:09:57 +0200 |
commit | 97d4714958663f2f463567664d8500984be6f704 (patch) | |
tree | 973698bfcda90eb405a7dfb0d8bde27e32243001 | |
parent | 8ab0428f54238a207df8682b586ea0c22240849f (diff) |
EiB is also cool
-rw-r--r-- | proxy.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -22,11 +22,11 @@ format_bytes(char *buf, size_t len, uint64_t val) const char *suffix = "B"; tmp = val * 10; - if (val > 1125899906842624ULL) { - if (val > (9223372036854775807ULL / 10)) - tmp = val / 112589990684262ULL; - else - tmp /= 1125899906842624ULL; + if (tx > 1152921504606846976ULL) { + tmp = val / 115292150460684697ULL; + suffix= "EiB"; + } else if (tx > 1125899906842624ULL) { + tmp /= 1125899906842624ULL; suffix = "PiB"; } else if (val > 1099511627776ULL) { tmp /= 1099511627776ULL; |