From: Matthew Fernandez Date: Wed, 28 Dec 2022 17:56:52 +0000 (-0800) Subject: common set_record_rects: use 'agxbprint' to simplify some code X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46057b4ae72ec589dd070babaa66fa0052a1a4e3;p=graphviz common set_record_rects: use 'agxbprint' to simplify some code This is similar to bb80d536e9cfdd4680254d9e91511b224a143eb4. --- diff --git a/lib/common/output.c b/lib/common/output.c index ac41a32ff..2aca14aaa 100644 --- a/lib/common/output.c +++ b/lib/common/output.c @@ -190,15 +190,13 @@ void write_plain(GVJ_t *job, graph_t *g, FILE *f, bool extend) { static void set_record_rects(node_t * n, field_t * f, agxbuf * xb) { int i; - char buf[BUFSIZ]; if (f->n_flds == 0) { - snprintf(buf, sizeof(buf), "%.5g,%.5g,%.5g,%.5g ", + agxbprint(xb, "%.5g,%.5g,%.5g,%.5g ", f->b.LL.x + ND_coord(n).x, YDIR(f->b.LL.y + ND_coord(n).y), f->b.UR.x + ND_coord(n).x, YDIR(f->b.UR.y + ND_coord(n).y)); - agxbput(xb, buf); } for (i = 0; i < f->n_flds; i++) set_record_rects(n, f->fld[i], xb);