Skip to content

Commit

Permalink
kbdcontrol: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Browse files Browse the repository at this point in the history
Pull Request: #888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
  • Loading branch information
ElyesH authored and bsdimp committed Apr 29, 2024
1 parent 8f65dcd commit 338d9c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion usr.sbin/kbdcontrol/kbdcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 338d9c3

Please sign in to comment.