From: Matthew Fernandez Date: Wed, 24 Feb 2021 03:51:22 +0000 (-0800) Subject: remove use of int as size_t in pathAppend X-Git-Tag: 2.47.0~17^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae18a513c43dc7ec7337e03c9f918d6c13187801;p=graphviz remove use of int as size_t in pathAppend This removes three -Wsign-conversion and -Wconversion warnings. --- diff --git a/cmd/lefty/common.c b/cmd/lefty/common.c index e9e9d977c..3249b27fa 100644 --- a/cmd/lefty/common.c +++ b/cmd/lefty/common.c @@ -11,12 +11,13 @@ /* Lefteris Koutsofios - AT&T Labs Research */ #include +#include #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;