From 7503a32bccae5949078dc7b3b7d15aaede25c4dc Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 16 May 2019 18:06:49 -0500 Subject: Use the space reserved in the header to display more precision. --- toys/posix/ps.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'toys/posix/ps.c') diff --git a/toys/posix/ps.c b/toys/posix/ps.c index 48bf1e3b..826fadc4 100644 --- a/toys/posix/ps.c +++ b/toys/posix/ps.c @@ -1581,8 +1581,9 @@ static void top_common( j = i%3; pos = strafter(toybuf+256, (char *[]){"MemTotal:","\nMemFree:", "\nBuffers:","\nSwapTotal:","\nSwapFree:","\nCached:"}[i]); - human_readable(hr[j+!!j], 1024*(run[i] = pos ? atol(pos) : 0), 0); - if (j==1) human_readable(hr[1], 1024*(run[i-1]-run[i]), 0); + human_readable_long(hr[j+!!j], 1024*(run[i] = pos?atol(pos):0), + 8, 0); + if (j==1) human_readable_long(hr[1], 1024*(run[i-1]-run[i]), 8,0); else if (j==2) { sprintf(toybuf, (i<3) ? " Mem: %9s total, %9s used, %9s free, %9s buffers" -- cgit v1.2.3