From 663a92b8ba330a1be301601655772532f663f69f Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sat, 3 Oct 2020 16:04:44 +0200 Subject: [PATCH] Show usage and exit non-zero for unsupported option in lib/pack/ptest.c Towards https://gitlab.com/graphviz/graphviz/-/issues/1843. --- lib/pack/ptest.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/pack/ptest.c b/lib/pack/ptest.c index fb3deddf4..83d9a3d07 100644 --- a/lib/pack/ptest.c +++ b/lib/pack/ptest.c @@ -86,9 +86,11 @@ static void init(int argc, char *argv[]) case '?': if (optopt == '?') usage(0); - else + else { fprintf(stderr, - "ptest: option -%c unrecognized - ignored\n", c); + "ptest: option -%c unrecognized\n", c); + usage(1); + } break; } } -- 2.40.0