From af8be8135996cc19c573d5e9965ec094528260eb Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sun, 4 Oct 2020 20:56:14 +0200 Subject: [PATCH] Explicitly specify -? as an option in nop --- cmd/tools/nop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/tools/nop.c b/cmd/tools/nop.c index 008a5fc8a..7cdbc9ed9 100644 --- a/cmd/tools/nop.c +++ b/cmd/tools/nop.c @@ -42,13 +42,13 @@ static void init(int argc, char *argv[]) int c; opterr = 0; - while ((c = getopt(argc, argv, "p")) != -1) { + while ((c = getopt(argc, argv, "p?")) != -1) { switch (c) { case 'p': chkOnly = 1; break; case '?': - if (optopt == '?') + if (optopt == '\0') usage(0); else { fprintf(stderr, "nop: option -%c unrecognized\n", -- 2.40.0