1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-07 14:24:14 +01:00

WINGs: Use the macro 'wlengthof' to get the number of element in an array

The new macro 'wlengthof' from WUtil makes code easier to read than the
previous [sizeof() / sizeof([0]) ] construct.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2013-11-08 21:18:20 +01:00
committed by Carlos R. Mafra
parent fd47650717
commit a3b6b62049
4 changed files with 6 additions and 6 deletions

View File

@@ -190,7 +190,7 @@ void menu_parser_define_macro(WMenuParser parser)
}
if (*parser->rd == ')') break;
if (macro->arg_count >= sizeof(arg_name) / sizeof(arg_name[0])) {
if (macro->arg_count >= wlengthof(arg_name)) {
WMenuParserError(parser, _("too many parameters for macro \"%s\" definition"), macro->name);
wfree(macro);
*parser->rd = '\0'; // fake end-of-line to avoid warnings from remaining line content