usbconfig: 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:14:17 +01:00 committed by Warner Losh
parent 4c6e656e2e
commit abab59f662

View File

@ -36,7 +36,7 @@
#include <grp.h>
#include <errno.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/param.h>
#include <libusb20_desc.h>
#include <libusb20.h>
@ -210,7 +210,7 @@ get_token(const char *str, uint8_t narg)
{
uint8_t n;
for (n = 0; n != (sizeof(token) / sizeof(token[0])); n++) {
for (n = 0; n != nitems(token); n++) {
if (strcasecmp(str, token[n].name) == 0) {
if (token[n].narg > narg) {
/* too few arguments */