From 8b902ec38726f73669db778e754a9d7739cc9752 Mon Sep 17 00:00:00 2001 From: Caleb Sander Mateos Date: Tue, 16 Jul 2024 13:11:34 -0600 Subject: [PATCH] util: remove redundant loop condition in argconfig_parse() Since options_count is computed as the number of options until the first one with a NULL option field, s->option and option_index < options_count are equivalent. Signed-off-by: Caleb Sander Mateos --- util/argconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/argconfig.c b/util/argconfig.c index 3424e691..371ab7f3 100644 --- a/util/argconfig.c +++ b/util/argconfig.c @@ -316,7 +316,7 @@ int argconfig_parse(int argc, char *argv[], const char *program_desc, return -errno; } - for (s = options; s->option && option_index < options_count; s++) { + for (s = options; s->option; s++) { if (s->short_option) { short_opts[short_index++] = s->short_option; if (s->argument_type == required_argument || -- 2.50.1