diff options
author | Elyes Haouas <ehaouas@noos.fr> | 2023-11-07 17:14:17 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2024-04-29 03:30:55 +0000 |
commit | abab59f662b380f5ad46de03f9818f8c1f5ca0c4 (patch) | |
tree | 7c86f32fb2031f8fc67814078621355dcf9cd9ad /usr.sbin | |
parent | 4c6e656e2e5a25773135a7469a647649147c90f4 (diff) | |
download | src-abab59f662b380f5ad46de03f9818f8c1f5ca0c4.tar.gz src-abab59f662b380f5ad46de03f9818f8c1f5ca0c4.zip |
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>
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/usbconfig/usbconfig.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/usbconfig/usbconfig.c b/usr.sbin/usbconfig/usbconfig.c index 7d257fea52cd..e28f8de9f75c 100644 --- a/usr.sbin/usbconfig/usbconfig.c +++ b/usr.sbin/usbconfig/usbconfig.c @@ -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 */ |