]> granicus.if.org Git - graphviz/commitdiff
Explicitly specify -? as an option in nop
authorMagnus Jacobsson <magnus.jacobsson@berotec.se>
Sun, 4 Oct 2020 18:56:14 +0000 (20:56 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Thu, 8 Oct 2020 19:10:25 +0000 (21:10 +0200)
cmd/tools/nop.c

index 008a5fc8a071a0a1a20349674b841459dcbad08f..7cdbc9ed9bc69e89f1025e6d4f76b3b0ff0d15ca 100644 (file)
@@ -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",