]> granicus.if.org Git - graphviz/commitdiff
gvpr: initialize a variable
authorCosta Shulyupin <constantine.shulyupin@gmail.com>
Sun, 27 Mar 2022 04:09:51 +0000 (07:09 +0300)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 2 Apr 2022 18:59:53 +0000 (11:59 -0700)
Squash
warning: ‘alpha’ may be used uninitialized in this function

One branch of conditional statement leaves variable alpha
uninitialized. Actually uninitialized value is not used,
but compiler still complains. So just add one assignment to
assumed 0.

BTW, the code can be refactored and shortened.
But it is preferable to just minimize the changes.

lib/gvpr/actions.c

index 6d2713366200553efda181d7034a1d92a5f2c56d..4697170483ff4c0d7159936cbe6d2bdb7a4c0836 100644 (file)
@@ -1291,6 +1291,7 @@ char *colorx (Expr_t* ex, char* incolor, char* fmt, Sfio_t* fp)
     }
     else if (*fmt == 'C') {
        type = CMYK_BYTE;
+       alpha = 0;
     }
     else
        return "";