mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-30 04:22:44 +00:00
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:
parent
70fad8acae
commit
d94c991f3b
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user