From b6fd32738e015d7320593e00156346e6f2c00068 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sun, 4 Oct 2020 20:58:25 +0200 Subject: [PATCH] Explicitly specify -? as an option in tred --- cmd/tools/tred.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/tools/tred.c b/cmd/tools/tred.c index 386b1f23d..4fec5e874 100644 --- a/cmd/tools/tred.c +++ b/cmd/tools/tred.c @@ -248,7 +248,7 @@ static void init(int argc, char *argv[]) CmdName = argv[0]; opterr = 0; - while ((c = getopt(argc, argv, "vr")) != -1) { + while ((c = getopt(argc, argv, "vr?")) != -1) { switch (c) { case 'v': Verbose = 1; @@ -257,7 +257,7 @@ static void init(int argc, char *argv[]) PrintRemovedEdges = 1; break; case '?': - if (optopt == '?') + if (optopt == '\0') usage(0); else { fprintf(stderr, "%s: option -%c unrecognized\n", -- 2.40.0