Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Jun 2017 06:46:40 +0000 (UTC)
From:      Marcelo Araujo <araujo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r319969 - head/usr.sbin/ip6addrctl
Message-ID:  <201706150646.v5F6kenB019160@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: araujo
Date: Thu Jun 15 06:46:40 2017
New Revision: 319969
URL: https://svnweb.freebsd.org/changeset/base/319969

Log:
  Use nitems() from sys/param.h.
  
  MFC after:	4 weeks.

Modified:
  head/usr.sbin/ip6addrctl/ip6addrctl.c

Modified: head/usr.sbin/ip6addrctl/ip6addrctl.c
==============================================================================
--- head/usr.sbin/ip6addrctl/ip6addrctl.c	Thu Jun 15 06:21:01 2017	(r319968)
+++ head/usr.sbin/ip6addrctl/ip6addrctl.c	Thu Jun 15 06:46:40 2017	(r319969)
@@ -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 */
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706150646.v5F6kenB019160>