mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-26 20:12:44 +00:00
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:
parent
4c6e656e2e
commit
abab59f662
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user