From d42456e1285a37a4589725fa2ead093821fa2e08 Mon Sep 17 00:00:00 2001 From: Marcelo Araujo Date: Thu, 15 Jun 2017 06:46:40 +0000 Subject: [PATCH] Use nitems() from sys/param.h. MFC after: 4 weeks. --- usr.sbin/ip6addrctl/ip6addrctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/ip6addrctl/ip6addrctl.c b/usr.sbin/ip6addrctl/ip6addrctl.c index d9bf89de68b7..79388ff28532 100644 --- a/usr.sbin/ip6addrctl/ip6addrctl.c +++ b/usr.sbin/ip6addrctl/ip6addrctl.c @@ -111,7 +111,7 @@ get_policy(void) struct in6_addrpolicy *buf; struct in6_addrpolicy *pol, *ep; - if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), NULL, &l, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), NULL, &l, NULL, 0) < 0) { err(1, "sysctl(IPV6CTL_ADDRCTLPOLICY)"); /* NOTREACHED */ } @@ -123,7 +123,7 @@ get_policy(void) errx(1, "malloc failed"); /* NOTREACHED */ } - if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), buf, &l, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), buf, &l, NULL, 0) < 0) { err(1, "sysctl(IPV6CTL_ADDRCTLPOLICY)"); /* NOTREACHED */ }