Use nitems() from sys/param.h.

MFC after:	2 weeks.
Sponsored by:	gandi.net (BSD Day Taiwan)
This commit is contained in:
Marcelo Araujo 2016-07-30 07:06:23 +00:00
parent 57185c52de
commit d19ba08a16
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=303545

View File

@ -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])