From a29639fcebde2e21f088008e83294a10fbbd6430 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Tue, 21 May 2019 13:24:28 +1000 Subject: [PATCH] [common] option: fix another invalid usage of an unset variable --- VERSION | 2 +- common/src/option.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/VERSION b/VERSION index b0e9657b..d905db71 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -a12-197-g51ca08719e+1 \ No newline at end of file +a12-198-g0605b7df8c+1 \ No newline at end of file diff --git a/common/src/option.c b/common/src/option.c index fe344ff0..c1a096f3 100644 --- a/common/src/option.c +++ b/common/src/option.c @@ -297,6 +297,13 @@ bool option_parse(int argc, char * argv[]) free(arg); } + if (!o) + { + DEBUG_WARN("Ignored unknown argument: %s", argv[a]); + free(value); + continue; + } + if (!value) { if (o->type == OPTION_TYPE_BOOL) @@ -311,13 +318,6 @@ bool option_parse(int argc, char * argv[]) } } - if (!o) - { - DEBUG_WARN("Ignored unknown argument: %s", argv[a]); - free(value); - continue; - } - option_set(o, value); free(value); }