From 92a9b0ea18ddfa6b2e8852390c854f529e419021 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sun, 4 Oct 2020 20:57:22 +0200 Subject: [PATCH] Explicitly specify -? as an option in sccmap --- cmd/tools/sccmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/tools/sccmap.c b/cmd/tools/sccmap.c index 6de217b62..f9a04dac8 100644 --- a/cmd/tools/sccmap.c +++ b/cmd/tools/sccmap.c @@ -339,7 +339,7 @@ static void scanArgs(int argc, char **argv) CmdName = argv[0]; opterr = 0; - while ((c = getopt(argc, argv, ":o:sdvS")) != EOF) { + while ((c = getopt(argc, argv, ":o:sdvS?")) != EOF) { switch (c) { case 's': StatsOnly = 1; @@ -363,7 +363,7 @@ static void scanArgs(int argc, char **argv) fprintf(stderr, "%s: option -%c missing argument - ignored\n", CmdName, optopt); break; case '?': - if (optopt == '?') + if (optopt == '\0') usage(0); else { fprintf(stderr, "%s: option -%c unrecognized\n", -- 2.40.0