setkey: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
This commit is contained in:
Elyes Haouas 2023-11-07 18:38:15 +01:00 committed by Warner Losh
parent 70fad8acae
commit d94c991f3b
1 changed files with 1 additions and 1 deletions

View File

@ -502,7 +502,7 @@ static const char *ipproto[] = {
};
#define STR_OR_ID(x, tab) \
(((x) < sizeof(tab)/sizeof(tab[0]) && tab[(x)]) ? tab[(x)] : numstr(x))
(((x) < nitems(tab) && tab[(x)]) ? tab[(x)] : numstr(x))
const char *
numstr(int x)