summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-06-11 00:09:57 +0200
committerDavid Härdeman <david@hardeman.nu>2020-06-11 00:09:57 +0200
commit97d4714958663f2f463567664d8500984be6f704 (patch)
tree973698bfcda90eb405a7dfb0d8bde27e32243001
parent8ab0428f54238a207df8682b586ea0c22240849f (diff)
EiB is also cool
-rw-r--r--proxy.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/proxy.c b/proxy.c
index 1ec9541..630d8d2 100644
--- a/proxy.c
+++ b/proxy.c
@@ -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;