rwhod: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
This commit is contained in:
Elyes Haouas 2023-11-07 18:13:47 +01:00 committed by Warner Losh
parent f93475cf0f
commit 4c6e656e2e

View File

@ -478,7 +478,7 @@ sender_process(void)
we->we_idle = htonl(now - stb.st_atime);
}
(void) getloadavg(avenrun,
sizeof(avenrun) / sizeof(avenrun[0]));
nitems(avenrun));
for (i = 0; i < 3; i++)
mywd.wd_loadav[i] = htonl((u_long)(avenrun[i] * 100));
cc = (char *)wend - (char *)&mywd;