]> granicus.if.org Git - graphviz/commitdiff
common set_record_rects: use 'agxbprint' to simplify some code
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 28 Dec 2022 17:56:52 +0000 (09:56 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 31 Dec 2022 22:31:10 +0000 (14:31 -0800)
This is similar to bb80d536e9cfdd4680254d9e91511b224a143eb4.

lib/common/output.c

index ac41a32ffb51aca444fcaeca0dde693cb04b2693..2aca14aaa431261fc81f43c95882d0c88c9e3d20 100644 (file)
@@ -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);