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

index d1320a2aac492a2695ba6f0f4116774c88b12047..e73bf9cad66a4feebbd39c5babd7cdb2704ded5c 100644 (file)
@@ -88,10 +88,10 @@ static void init(int argc, char *argv[])
     int c;
 
     opterr = 0;
-    while ((c = getopt(argc, argv, ":")) != -1) {
+    while ((c = getopt(argc, argv, ":?")) != -1) {
        switch (c) {
        case '?':
-           if (optopt == '?')
+           if (optopt == '\0')
                usage(0);
            else {
                fprintf(stderr, "gvcolor: option -%c unrecognized\n",