]> granicus.if.org Git - graphviz/commitdiff
use agxbprint in genBundleColors
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 6 Sep 2020 15:43:04 +0000 (08:43 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 17 Sep 2020 04:08:22 +0000 (21:08 -0700)
cmd/mingle/minglemain.c

index 551afbf9e060e31a2cfecd574b3b750d1500cb05..1144b35db968e8d639c7fb8300262b4acc628940 100644 (file)
@@ -304,7 +304,6 @@ genBundleColors (pedge edge, agxbuf* xb, real maxwgt)
        int dim = edge->dim;
        real* x = edge->x;
        real* lens = MALLOC(sizeof(real)*edge->npoints);
-       char buf[BUFSIZ];
 
        for (j = 0; j < edge->npoints - 1; j++){
                len = 0;
@@ -319,11 +318,9 @@ genBundleColors (pedge edge, agxbuf* xb, real maxwgt)
                /* interpolate between red (t = 1) to blue (t = 0) */
                r = 255*t; g = 0; b = 255*(1-t);
                if (j != 0) agxbputc(xb,':');
-               sprintf(buf, "#%02x%02x%02x%02x", r, g, b, 85);
-               agxbput(xb, buf);
+               agxbprint(xb, "#%02x%02x%02x%02x", r, g, b, 85);
                if (j < edge->npoints-2) {
-                       sprintf(buf,";%f",lens[j]/len_total0);
-                       agxbput(xb, buf);
+                       agxbprint(xb,";%f",lens[j]/len_total0);
                }
        }
        free (lens);