]> granicus.if.org Git - procps-ng/commitdiff
free: --si changes base of default output
authorJan Rybar <jrybar@redhat.com>
Wed, 28 Sep 2022 07:57:03 +0000 (07:57 +0000)
committerCraig Small <csmall@dropbear.xyz>
Wed, 28 Sep 2022 07:57:03 +0000 (07:57 +0000)
src/free.c

index 3e3f23e1b3b1c4ab99b5ca8ea51bdbf0d37a58c3..73405dd38c979dc7caa30b8004f1d563b5d32860 100644 (file)
@@ -123,7 +123,7 @@ static const char *scale_size(unsigned long size, int flags, struct commandline_
                switch (args.exponent) {
                case 0:
                        /* default output */
-                       snprintf(buf, sizeof(buf), "%ld", size);
+                       snprintf(buf, sizeof(buf), "%ld", (long int)(bytes / (long long int)base));
                        return buf;
                case 1:
                        /* in bytes, which can not be in SI */