]> granicus.if.org Git - graphviz/commitdiff
simplify clustNode with agxbprint
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 6 Sep 2020 17:21:09 +0000 (10:21 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 17 Sep 2020 04:08:23 +0000 (21:08 -0700)
lib/common/utils.c

index e926295068045eacb2b06b289772d4a8f518a5f6..3aeac0c8f3590cd8bec996ba9f7d48fdf1087b0e 100644 (file)
@@ -957,13 +957,8 @@ static node_t *clustNode(node_t * n, graph_t * cg, agxbuf * xb,
 {
     node_t *cn;
     static int idx = 0;
-    char num[100];
 
-    agxbput(xb, "__");
-    sprintf(num, "%d", idx++);
-    agxbput(xb, num);
-    agxbputc(xb, ':');
-    agxbput(xb, agnameof(cg));
+    agxbprint(xb, "__%d:%s", idx++, agnameof(cg));
 
     cn = agnode(agroot(cg), agxbuse(xb), 1);
     agbindrec(cn, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);