Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Jul 2016 07:06:23 +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: r303545 - head/usr.bin/netstat
Message-ID:  <201607300706.u6U76Nc8095006@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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])



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