From 282f928dc777faf3cee67a648bb770bbd54276d0 Mon Sep 17 00:00:00 2001 From: pfg Date: Sat, 16 Apr 2016 17:52:00 +0000 Subject: libc: make some more use of the nitems() macro. We have an nitems() macro in the header that is convenient to re-use as it makes things easier to read. Given that it is available already without adding additional headers and other parts of libc already use it, extend a bit more its use. --- lib/libc/net/name6.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libc/net/name6.c') diff --git a/lib/libc/net/name6.c b/lib/libc/net/name6.c index 51e2da15..1d37329 100644 --- a/lib/libc/net/name6.c +++ b/lib/libc/net/name6.c @@ -735,11 +735,11 @@ get_addrselectpolicy(struct policyhead *head) char *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) return (0); if ((buf = malloc(l)) == NULL) return (0); - if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), buf, &l, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), buf, &l, NULL, 0) < 0) { free(buf); return (0); } -- cgit v1.1