]> granicus.if.org Git - graphviz/commitdiff
prformat: use a size_t when dealing with string lengths
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 24 Jul 2021 23:12:09 +0000 (16:12 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 28 Jul 2021 00:17:07 +0000 (17:17 -0700)
Squashes three -Wconversion warnings.

lib/expr/exeval.c

index d23e5e5683269e5f6b6220e079a7e58a2134c576..eb50fbad14e9843a87e7ca3d42a837e3e4dfe171 100644 (file)
@@ -197,7 +197,6 @@ prformat(Sfio_t* sp, void* vp, Sffmt_t* dp)
        Exnode_t*       node;
        char*           s;
        char*           txt;
-       int                     n;
        int                     from;
        int                     to = 0;
        time_t                  tm;
@@ -255,7 +254,7 @@ prformat(Sfio_t* sp, void* vp, Sffmt_t* dp)
                        {
                                if (fmt->value.string)
                                {
-                                       n = strlen(fmt->value.string);
+                                       size_t n = strlen(fmt->value.string);
                                        if ((s = fmtbuf(n + 1)))
                                                memcpy(s, fmt->value.string, n + 1);
                                        vmfree(fmt->expr->vm, fmt->value.string);