From: Matthew Fernandez Date: Tue, 1 Sep 2020 00:36:31 +0000 (-0700) Subject: use agxbprint in genBundleSpline, removing the need for a temporary buffer X-Git-Tag: 2.46.0~20^2^2~77^2~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=db32922bd40a9f4dc024863c76ac9a2cfeb9fe55;p=graphviz use agxbprint in genBundleSpline, removing the need for a temporary buffer --- diff --git a/cmd/mingle/minglemain.c b/cmd/mingle/minglemain.c index 31013c650..522e424cd 100644 --- a/cmd/mingle/minglemain.c +++ b/cmd/mingle/minglemain.c @@ -242,7 +242,6 @@ static void genBundleSpline (pedge edge, agxbuf* xb) { int k, j, mm, kk; - char buf[BUFSIZ]; int dim = edge->dim; real* x = edge->x; real tt1[3]={0.15,0.5,0.85}; @@ -263,8 +262,7 @@ genBundleSpline (pedge edge, agxbuf* xb) t = tt[kk-1]; for (k = 0; k < dim; k++) { if (k != 0) agxbputc(xb,','); - sprintf(buf, "%.03f", (x[(j-1)*dim+k]*(1-t)+x[j*dim+k]*(t))); - agxbput(xb, buf); + agxbprint(xb, "%.03f", (x[(j-1)*dim+k]*(1-t)+x[j*dim+k]*(t))); } agxbputc(xb,' '); } @@ -272,8 +270,7 @@ genBundleSpline (pedge edge, agxbuf* xb) if ((j == 0) || (j == edge->npoints - 1)) { for (k = 0; k < dim; k++) { if (k != 0) agxbputc(xb,','); - sprintf(buf, "%.03f", x[j*dim+k]); - agxbput(xb, buf); + agxbprint(xb, "%.03f", x[j*dim+k]); } } }