aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2019-05-16 18:06:49 -0500
committerRob Landley <rob@landley.net>2019-05-16 18:06:49 -0500
commit7503a32bccae5949078dc7b3b7d15aaede25c4dc (patch)
treef303e5524e1a6805a7d015d82c9667bda9faa75d
parent0536f45747a991a21b2b544f556da704eed22bd4 (diff)
downloadtoybox-7503a32bccae5949078dc7b3b7d15aaede25c4dc.tar.gz
Use the space reserved in the header to display more precision.
-rw-r--r--toys/posix/ps.c5
1 files changed, 3 insertions, 2 deletions
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"