]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Try unsigned long long
authorScott Baker <scott@perturb.org>
Sat, 5 Jun 2021 18:11:09 +0000 (11:11 -0700)
committerW. Felix Handte <w@felixhandte.com>
Thu, 10 Jun 2021 16:53:07 +0000 (12:53 -0400)
programs/util.c
programs/util.h

index c2883ba7d2ffa441e794060f53f8c50bbd932d8d..1ca8eec190249cc78ceba29e168837a4dde3a356 100644 (file)
@@ -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';
        }
index 21e93d7d7aaa3b3e1cac54919b1caa02ec923b55..0eb64c013b46a5c4920a71ee199267cd2b6f0d6e 100644 (file)
@@ -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.