From 63e745571676911e8e000eb0e755a502d4ff87fe Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sun, 4 Oct 2020 20:47:47 +0200 Subject: [PATCH] Explicitly specify -? as an option in ccomps --- cmd/tools/ccomps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/tools/ccomps.c b/cmd/tools/ccomps.c index 8cedc8a66..68f638997 100644 --- a/cmd/tools/ccomps.c +++ b/cmd/tools/ccomps.c @@ -136,7 +136,7 @@ static void init(int argc, char *argv[]) Cmd = argv[0]; opterr = 0; - while ((c = getopt(argc, argv, ":zo:xCX:nesv")) != -1) { + while ((c = getopt(argc, argv, ":zo:xCX:nesv?")) != -1) { switch (c) { case 'o': outfile = optarg; @@ -205,7 +205,7 @@ static void init(int argc, char *argv[]) "ccomps: option -%c missing argument - ignored\n", optopt); break; case '?': - if (optopt == '?') + if (optopt == '\0') usage(0); else { fprintf(stderr, -- 2.40.0