]> granicus.if.org Git - graphviz/commitdiff
Explicitly specify -? as an option in lib/spine/spine.c
authorMagnus Jacobsson <magnus.jacobsson@berotec.se>
Sat, 3 Oct 2020 14:17:01 +0000 (16:17 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Thu, 8 Oct 2020 19:10:26 +0000 (21:10 +0200)
lib/spine/spine.c

index 791dc4580df99f78d3ce4878a053c3fff6477bcd..4bdab515b32085990ec27165df4013affc42d82f 100644 (file)
@@ -610,7 +610,7 @@ static void doOpts(int argc, char *argv[], opts_t * op)
        op->sparse_ratio = 0.5;
 
        opterr = 0;
-       while ((c = getopt(argc, argv, "o:r:v::")) != -1) {
+       while ((c = getopt(argc, argv, "o:r:v::?")) != -1) {
                switch (c) {
                case 'o':
                        op->outfp = openFile(cmd, optarg, "w");
@@ -632,7 +632,7 @@ static void doOpts(int argc, char *argv[], opts_t * op)
                        }
                        break;
                case '?':
-                       if (optopt == '?')
+                       if (optopt == '\0')
                                usage(cmd, 0);
                        else {
                                fprintf(stderr, "%s: option -%c unrecognized\n",