From: Adam Sampson Date: Tue, 26 Jun 2012 13:06:45 +0000 (+0100) Subject: Show sizes > 4G correctly in bytes on 32-bit machines. X-Git-Tag: v3.3.4~53 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ecc265492fbf6693de5ed7329b9640edb8b6e795;p=procps-ng Show sizes > 4G correctly in bytes on 32-bit machines. size is a long; this needs to be a 64-bit multiplication. --- diff --git a/free.c b/free.c index 849f4e4c..ecaeccdd 100644 --- a/free.c +++ b/free.c @@ -121,7 +121,7 @@ static const char *scale_size(unsigned long size, int flags, struct commandline_ if (!(flags & FREE_HUMANREADABLE)) { if (args.exponent == 1) { /* in bytes, which can not be in SI */ - snprintf(buf, sizeof(buf), "%lld", (long long int)(size * 1024)); + snprintf(buf, sizeof(buf), "%lld", ((long long int)size) * 1024); return buf; } if (args.exponent == 2) {