]> granicus.if.org Git - graphviz/commitdiff
bcomps getName: use size_t for buffer lengths
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 13 Nov 2021 03:26:31 +0000 (19:26 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 19 Nov 2021 01:52:33 +0000 (17:52 -0800)
Squashes some -Wconversion warnings.

cmd/tools/bcomps.c

index 52461a29e9373222930d5e67de3fcc3feb72208b..2648fd004b01f342ea1e99b4c190b99d2199c1f0 100644 (file)
@@ -112,13 +112,12 @@ static char *getName(int ng, int nb)
 {
     char *name;
     static char *buf;
-    int sz;
 
     if ((ng == 0) && (nb == 0))
        name = outfile;
     else {
        if (!buf) {
-           sz = strlen(outfile) + 100; /* enough to handle '_<g>_<b>' */
+           size_t sz = strlen(outfile) + 100; // enough to handle '_<g>_<b>'
            buf = malloc(sz);
        }
        if (suffix) {