Remove extra spaces for the load average of machines that are down.

PR:		245296
Submitted by:	martin _at_ lispworks.com
MFC after:	1 week
This commit is contained in:
Yoshihiro Takahashi 2020-04-04 12:07:36 +00:00
parent d2034aedc1
commit ba2c1f62af

View File

@ -234,18 +234,21 @@ ruptime(const char *host, int aflg, int (*cmp)(const void *, const void *))
if (hostnamewidth < (int)strlen(wd->wd_hostname)) if (hostnamewidth < (int)strlen(wd->wd_hostname))
hostnamewidth = (int)strlen(wd->wd_hostname); hostnamewidth = (int)strlen(wd->wd_hostname);
if (!ISDOWN(hsp)) {
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
w = iwidth(wd->wd_loadav[i] / 100) + 3; w = iwidth(wd->wd_loadav[i] / 100) + 3;
if (loadavwidth[i] < w) if (loadavwidth[i] < w)
loadavwidth[i] = w; loadavwidth[i] = w;
} }
for (hsp->hs_nusers = 0, we = &wd->wd_we[0]; for (hsp->hs_nusers = 0, we = &wd->wd_we[0];
(char *)(we + 1) <= (char *)wd + cc; we++) (char *)(we + 1) <= (char *)wd + cc; we++)
if (aflg || we->we_idle < 3600) if (aflg || we->we_idle < 3600)
++hsp->hs_nusers; ++hsp->hs_nusers;
if (userswidth < iwidth(hsp->hs_nusers)) if (userswidth < iwidth(hsp->hs_nusers))
userswidth = iwidth(hsp->hs_nusers); userswidth = iwidth(hsp->hs_nusers);
}
++hsp; ++hsp;
++nhosts; ++nhosts;
} }