aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorPiotr Kubaj <pkubaj@FreeBSD.org>2024-05-21 10:28:35 +0000
committerPiotr Kubaj <pkubaj@FreeBSD.org>2024-05-22 14:47:46 +0000
commitb7f62c6042f8b4b322d9fa20a8c6a81a9a58c164 (patch)
treea4dbac6b68891370e39a2dfa6abe24184edb390d /usr.bin
parenteaab8e4166a02212cb7d6aea4304834d9bcf5ff9 (diff)
downloadsrc-b7f62c6042f8b4b322d9fa20a8c6a81a9a58c164.tar.gz
src-b7f62c6042f8b4b322d9fa20a8c6a81a9a58c164.zip
usr.bin/top: fix displaying load average for loads of at least 100
After top registers load average of at least 100 which then gets reduced to below 100, there are left stray digits. Supporting load over 100 requires increasing the width only to 6, but since we support over 1000 CPU's now, let's increase it to 7. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D45284
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/top/display.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/top/display.c b/usr.bin/top/display.c
index 32b8b12798dc..b6cde0e63aa7 100644
--- a/usr.bin/top/display.c
+++ b/usr.bin/top/display.c
@@ -252,7 +252,7 @@ i_loadave(int mpid, double avenrun[])
for (i = 0; i < 3; i++)
{
- printf("%c %5.2f",
+ printf("%c %7.2f",
i == 0 ? ':' : ',',
avenrun[i]);
}
@@ -289,7 +289,7 @@ u_loadave(int mpid, double *avenrun)
/* we should optimize this and only display changes */
for (i = 0; i < 3; i++)
{
- printf("%s%5.2f",
+ printf("%s%7.2f",
i == 0 ? "" : ", ",
avenrun[i]);
}