From: Richard Russon Date: Mon, 16 Oct 2017 13:14:19 +0000 (+0100) Subject: use mutt_array_size() X-Git-Tag: neomutt-20171027~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3abefed81ef81f92e6b002d30ed008a11a40b76b;p=neomutt use mutt_array_size() --- diff --git a/keymap.c b/keymap.c index 6eb6fcc77..01f984ba4 100644 --- a/keymap.c +++ b/keymap.c @@ -1093,7 +1093,7 @@ int mutt_parse_bind(struct Buffer *buf, struct Buffer *s, unsigned long data, char *key = NULL; int menu[sizeof(Menus) / sizeof(struct Mapping) - 1], r = 0, nummenus; - key = parse_keymap(menu, s, sizeof(menu) / sizeof(menu[0]), &nummenus, err); + key = parse_keymap(menu, s, mutt_array_size(menu), &nummenus, err); if (!key) return -1; @@ -1151,7 +1151,7 @@ int mutt_parse_macro(struct Buffer *buf, struct Buffer *s, unsigned long data, char *seq = NULL; char *key = NULL; - key = parse_keymap(menu, s, sizeof(menu) / sizeof(menu[0]), &nummenus, err); + key = parse_keymap(menu, s, mutt_array_size(menu), &nummenus, err); if (!key) return -1; @@ -1230,7 +1230,7 @@ int mutt_parse_exec(struct Buffer *buf, struct Buffer *s, unsigned long data, return -1; } nops++; - } while (MoreArgs(s) && nops < sizeof(ops) / sizeof(ops[0])); + } while (MoreArgs(s) && nops < mutt_array_size(ops)); while (nops) mutt_push_macro_event(0, ops[--nops]);