From 712433d7f9841248c0b18a4ca917658a6a59e3cd Mon Sep 17 00:00:00 2001 From: Ingo Franzki Date: Tue, 9 Jul 2019 16:04:28 +0200 Subject: [PATCH] util_opt: Correct util_opt_example to handle all possible options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The util_opt_example allows to specify '-l' and '-m, --manual' options, but does not handle them. This leads to error message 'PANIC: The application terminated due to an unrecoverable error' with 'Option 'l' should not be handled here' and the program is aborted. Add the required case statements in the switch to handle those options. Signed-off-by: Ingo Franzki Signed-off-by: Jan Höppner --- libutil/util_opt_example.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libutil/util_opt_example.c b/libutil/util_opt_example.c index d98360c1..816ab3b6 100644 --- a/libutil/util_opt_example.c +++ b/libutil/util_opt_example.c @@ -112,6 +112,12 @@ int main(int argc, char *argv[]) case OPT_NOSHORT: printf("Specified: --noshort\n"); break; + case 'l': + printf("Specified: -l\n"); + break; + case 'm': + printf("Specified: --manual\n"); + break; default: util_opt_print_parse_error(c, argv); return EXIT_FAILURE;