diff options
author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2016-04-16 17:52:00 +0000 |
---|---|---|
committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2016-04-16 17:52:00 +0000 |
commit | bf51882a09fb19789665c0b385c5fa2f51331079 (patch) | |
tree | 9591d290a7b32152d9fdda623974bad433ef861f /lib/libc/net/name6.c | |
parent | da72d0ec065f48c496818cccc459f97c565c99d9 (diff) | |
download | src-bf51882a09fb19789665c0b385c5fa2f51331079.tar.gz src-bf51882a09fb19789665c0b385c5fa2f51331079.zip |
libc: make some more use of the nitems() macro.
We have an nitems() macro in the <sys/param.h> 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.
Notes
Notes:
svn path=/head/; revision=298120
Diffstat (limited to 'lib/libc/net/name6.c')
-rw-r--r-- | lib/libc/net/name6.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/net/name6.c b/lib/libc/net/name6.c index 51e2da15a23f..1d37329a4d34 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); } |