]> granicus.if.org Git - graphviz/commitdiff
remove use of int as size_t in pathAppend
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 24 Feb 2021 03:51:22 +0000 (19:51 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 2 Mar 2021 06:05:11 +0000 (22:05 -0800)
This removes three -Wsign-conversion and -Wconversion warnings.

cmd/lefty/common.c

index e9e9d977ccb6e37064b7d1a56e51ffa169282d91..3249b27fa4dca0027cbcf15c0ce932c55e5c7b3e 100644 (file)
 /* Lefteris Koutsofios - AT&T Labs Research */
 
 #include <stdbool.h>
+#include <stddef.h>
 #include "common.h"
 
 int warnflag;
 char *leftypath, *leftyoptions, *shellpath;
-static int leftypathsz;
-static int leftypathlen;
+static size_t leftypathsz;
+static size_t leftypathlen;
 jmp_buf exitljbuf;
 int idlerunmode;
 fd_set inputfds;
@@ -59,7 +60,7 @@ static char *lpathp;
 
 static void pathAppend(char* s, bool addSep)
 {
-    int newlen = leftypathlen + strlen(s) + (addSep ? 1 : 0);
+    size_t newlen = leftypathlen + strlen(s) + (addSep ? 1 : 0);
 
     if (newlen >= leftypathsz) {
        leftypathsz = newlen + 1024;