mirror of
https://github.com/opnsense/src.git
synced 2026-06-14 19:20:18 -04:00
ctld: 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
2f8ea2f605
commit
8f65dcd627
1 changed files with 2 additions and 2 deletions
|
|
@ -168,7 +168,7 @@ cctl_start_element(void *user_data, const char *name, const char **attr)
|
|||
if ((u_int)devlist->level >= (sizeof(devlist->cur_sb) /
|
||||
sizeof(devlist->cur_sb[0])))
|
||||
log_errx(1, "%s: too many nesting levels, %zd max", __func__,
|
||||
sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0]));
|
||||
nitems(devlist->cur_sb));
|
||||
|
||||
devlist->cur_sb[devlist->level] = sbuf_new_auto();
|
||||
if (devlist->cur_sb[devlist->level] == NULL)
|
||||
|
|
@ -290,7 +290,7 @@ cctl_start_pelement(void *user_data, const char *name, const char **attr)
|
|||
if ((u_int)devlist->level >= (sizeof(devlist->cur_sb) /
|
||||
sizeof(devlist->cur_sb[0])))
|
||||
log_errx(1, "%s: too many nesting levels, %zd max", __func__,
|
||||
sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0]));
|
||||
nitems(devlist->cur_sb));
|
||||
|
||||
devlist->cur_sb[devlist->level] = sbuf_new_auto();
|
||||
if (devlist->cur_sb[devlist->level] == NULL)
|
||||
|
|
|
|||
Loading…
Reference in a new issue