]> granicus.if.org Git - graphviz/commitdiff
gvpr mkBlock: remove an unnecessary use of an sfio buffer
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 11 Sep 2021 18:27:30 +0000 (11:27 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 18 Sep 2021 22:14:15 +0000 (15:14 -0700)
Related to #1873, #1998.

lib/gvpr/compile.c

index e41380a9ad5ba06df2dbae7aa8156c42b29fbe0b..2442ac6098421ffff611723ffcc4972448fdc769 100644 (file)
@@ -2371,11 +2371,13 @@ static int mkBlock(comp_block* bp, Expr_t * prog, char *src, parse_block *inp, S
 
     codePhase = 1;
     if (inp->begg_stmt) {
-       sfprintf(tmps, "_begin_g_%d", i);
+       static const char PREFIX[] = "_begin_g_";
+       char label[sizeof(PREFIX) - 1 + CHARS_FOR_NUL_TERM_INT - 1 + 1 /* for NUL */];
+       snprintf(label, sizeof(label), "%s%d", PREFIX, i);
        symbols[0].type = T_graph;
        tchk[V_this][1] = Y(G);
        bp->begg_stmt = compile(prog, src, inp->begg_stmt,
-                              inp->l_beging, sfstruse(tmps), 0, VOIDTYPE);
+                          inp->l_beging, label, 0, VOIDTYPE);
        if (getErrorErrors())
            goto finishBlk;
        rv |= BEGG;