svn commit: r303545 - head/usr.bin/netstat

Marcelo Araujo araujo at FreeBSD.org
Sat Jul 30 07:06:24 UTC 2016


Author: araujo
Date: Sat Jul 30 07:06:23 2016
New Revision: 303545
URL: https://svnweb.freebsd.org/changeset/base/303545

Log:
  Use nitems() from sys/param.h.
  
  MFC after:	2 weeks.
  Sponsored by:	gandi.net (BSD Day Taiwan)

Modified:
  head/usr.bin/netstat/pfkey.c

Modified: head/usr.bin/netstat/pfkey.c
==============================================================================
--- head/usr.bin/netstat/pfkey.c	Sat Jul 30 07:05:32 2016	(r303544)
+++ head/usr.bin/netstat/pfkey.c	Sat Jul 30 07:06:23 2016	(r303545)
@@ -101,8 +101,7 @@ static const char *pfkey_msgtype_names (
 static const char *
 pfkey_msgtype_names(int x)
 {
-	const int max =
-	    sizeof(pfkey_msgtypenames)/sizeof(pfkey_msgtypenames[0]);
+	const int max = nitems(pfkey_msgtypenames);
 	static char buf[20];
 
 	if (x < max && pfkey_msgtypenames[x])


More information about the svn-src-head mailing list