From db32922bd40a9f4dc024863c76ac9a2cfeb9fe55 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Mon, 31 Aug 2020 17:36:31 -0700 Subject: [PATCH] use agxbprint in genBundleSpline, removing the need for a temporary buffer --- cmd/mingle/minglemain.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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]); } } } -- 2.40.0