git: 338d9c35d55d - main - kbdcontrol: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 29 Apr 2024 04:27:18 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=338d9c35d55dd69c02d2d7d887ee658eaa667bac
commit 338d9c35d55dd69c02d2d7d887ee658eaa667bac
Author: Elyes Haouas <ehaouas@noos.fr>
AuthorDate: 2023-11-07 17:11:56 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-04-29 03:24:47 +0000
kbdcontrol: 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>
---
usr.sbin/kbdcontrol/kbdcontrol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c
index e55165fd0888..4e27febe2164 100644
--- a/usr.sbin/kbdcontrol/kbdcontrol.c
+++ b/usr.sbin/kbdcontrol/kbdcontrol.c
@@ -1117,7 +1117,7 @@ get_kbd_type_name(int type)
};
unsigned int i;
- for (i = 0; i < sizeof(name_table)/sizeof(name_table[0]); ++i) {
+ for (i = 0; i < nitems(name_table); ++i) {
if (type == name_table[i].type)
return name_table[i].name;
}