free: Update tests and fix for previous patch
The previous two patches updated free, but needed a tweak and the tests
also needed to be updated. I've hand-calculated the results using bc and
both the testsuite and bc results equal what free prints out.
References:
commit 9365be7633
procps-ng/procps#45
This commit is contained in:
2
free.c
2
free.c
@ -133,7 +133,7 @@ static const char *scale_size(unsigned long size, int flags, struct commandline_
|
||||
if (args.exponent > 1) {
|
||||
/* In desired scale. */
|
||||
snprintf(buf, sizeof(buf), "%ld",
|
||||
(long int)((size / 1024) * base / power(base, args.exponent - 2))
|
||||
(long int)((size * 1024) / power(base, args.exponent-1))
|
||||
);
|
||||
return buf;
|
||||
}
|
||||
|
Reference in New Issue
Block a user