]> granicus.if.org Git - graphviz/commitdiff
gxl2gv pushString: use 'size_t' to track buffer size
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 17 Sep 2021 04:02:31 +0000 (21:02 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 19 Sep 2021 23:21:06 +0000 (16:21 -0700)
Squashes -Wconversion warnings.

cmd/tools/gxl2gv.c

index d8fc152755559c604ea17c97296489aae01e3542..0d8f4e8b7d99b22b1c615621c6e5c722f8d9816b 100644 (file)
@@ -15,6 +15,7 @@
 #include    <expat.h>
 #include    <ctype.h>
 #include    <stdbool.h>
+#include    <stdlib.h>
 
 #ifndef XML_STATUS_ERROR
 #define XML_STATUS_ERROR 0
@@ -64,7 +65,7 @@ static void *gcalloc(size_t nmemb, size_t size)
 
 static void pushString(slist ** stk, const char *s)
 {
-    int sz = ROUND2(sizeof(slist) + strlen(s), sizeof(void *));
+    size_t sz = ROUND2(sizeof(slist) + strlen(s), sizeof(void *));
     slist *sp = gcalloc(sz, sizeof(char));
     strcpy(sp->buf, s);
     sp->next = *stk;