From 4c6e656e2e5a25773135a7469a647649147c90f4 Mon Sep 17 00:00:00 2001 From: Elyes Haouas Date: Tue, 7 Nov 2023 18:13:47 +0100 Subject: [PATCH] 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 --- usr.sbin/rwhod/rwhod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/rwhod/rwhod.c b/usr.sbin/rwhod/rwhod.c index 2f589e2492e3..237663eef74d 100644 --- a/usr.sbin/rwhod/rwhod.c +++ b/usr.sbin/rwhod/rwhod.c @@ -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;