Use nitems() from sys/param.h.

MFC after:	2 weeks.
This commit is contained in:
Marcelo Araujo 2016-04-19 06:34:31 +00:00
parent c52ee6c23b
commit 1068140988

View File

@ -2495,7 +2495,7 @@ pr_icmph(struct icmp6_hdr *icp, u_char *end)
break;
}
if (options & F_VERBOSE) {
if (ni->ni_code > sizeof(nircode) / sizeof(nircode[0]))
if (ni->ni_code > nitems(nircode))
printf(", invalid");
else
printf(", %s", nircode[ni->ni_code]);