From ecc265492fbf6693de5ed7329b9640edb8b6e795 Mon Sep 17 00:00:00 2001 From: Adam Sampson Date: Tue, 26 Jun 2012 14:06:45 +0100 Subject: [PATCH] Show sizes > 4G correctly in bytes on 32-bit machines. size is a long; this needs to be a 64-bit multiplication. --- free.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {