]> granicus.if.org Git - graphviz/commitdiff
bbOf: use size_t for string length
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 19 Jul 2021 00:43:23 +0000 (17:43 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 28 Jul 2021 15:02:00 +0000 (08:02 -0700)
Squashes a -Wsign-conversion warning.

lib/gvpr/compile.c

index 5c0d9384021eb3022dedc7fab6abdd5273717ff5..9d0034bc48a549e9b3131fcd134fdb2934a686ca 100644 (file)
@@ -118,13 +118,12 @@ static char *bbOf(Expr_t * pgm, char *pt, bool getll)
     double x, y, u, v;
     char *s;
     char *p;
-    int len;
 
     if (sscanf(pt, "%lf,%lf,%lf,%lf", &x, &y, &u, &v) == 4) {
        p = strchr(pt, ',');
        p = strchr(p + 1, ',');
        if (getll) {
-           len = p - pt;
+           size_t len = (size_t)(p - pt);
            s = exstralloc(pgm, len + 1);
            strncpy(s, pt, len);
            s[len] = '\0';