From d19ba08a1672cf3d710ed46e897690c16f0282c6 Mon Sep 17 00:00:00 2001 From: Marcelo Araujo Date: Sat, 30 Jul 2016 07:06:23 +0000 Subject: [PATCH] Use nitems() from sys/param.h. MFC after: 2 weeks. Sponsored by: gandi.net (BSD Day Taiwan) --- usr.bin/netstat/pfkey.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.bin/netstat/pfkey.c b/usr.bin/netstat/pfkey.c index 1a60b488462c..e12181b3afa3 100644 --- a/usr.bin/netstat/pfkey.c +++ b/usr.bin/netstat/pfkey.c @@ -101,8 +101,7 @@ static const char *pfkey_msgtype_names (int); 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])