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
This commit is contained in:
Piotr Kubaj 2024-05-21 12:28:35 +02:00
parent eaab8e4166
commit b7f62c6042

View file

@ -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]);
}