From 20b9b00b413c799bef54bfeb2a36256f11d65b06 Mon Sep 17 00:00:00 2001 From: Scott Baker Date: Sat, 5 Jun 2021 11:11:09 -0700 Subject: [PATCH] Try unsigned long long --- programs/util.c | 4 ++-- programs/util.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/programs/util.c b/programs/util.c index c2883ba7d..1ca8eec19 100644 --- a/programs/util.c +++ b/programs/util.c @@ -121,7 +121,7 @@ int UTIL_requireUserConfirmation(const char* prompt, const char* abortMsg, * Functions ***************************************/ -char* humanSize(unsigned long size, char* str) { +char* humanSize(unsigned long long size, char* str) { /* This only works on 64 bit platforms so I commented it out for now */ /* if (size > 1125899906842624L) { @@ -137,7 +137,7 @@ char* humanSize(unsigned long size, char* str) { } else if (size > 1024) { snprintf(str, 7, "%.1fK", (float)size / 1024); } else if (size <= 1024) { - snprintf(str, 7, "%luB", size); + snprintf(str, 7, "%lluB", size); } else { str[0] = '\0'; } diff --git a/programs/util.h b/programs/util.h index 21e93d7d7..0eb64c013 100644 --- a/programs/util.h +++ b/programs/util.h @@ -122,7 +122,7 @@ int UTIL_requireUserConfirmation(const char* prompt, const char* abortMsg, const #define STRDUP(s) strdup(s) #endif -char* humanSize(unsigned long size, char* str); +char* humanSize(unsigned long long size, char* str); /** * Calls platform's equivalent of stat() on filename and writes info to statbuf.