]> granicus.if.org Git - graphviz/commitdiff
bcomps blockName: use size_t for buffer lengths
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 13 Nov 2021 03:24:58 +0000 (19:24 -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 03923d5b45404bdc0fcad9836fecc2b669fea6e5..52461a29e9373222930d5e67de3fcc3feb72208b 100644 (file)
@@ -87,10 +87,9 @@ typedef struct {
 static char *blockName(char *gname, int d)
 {
     static char *buf;
-    static int bufsz;
-    int sz;
+    static size_t bufsz;
 
-    sz = strlen(gname) + 128;
+    size_t sz = strlen(gname) + 128;
     if (sz > bufsz) {
        free(buf);
        buf = malloc(sz);