From: Matthew Fernandez Date: Sun, 6 Sep 2020 16:41:07 +0000 (-0700) Subject: simplify makeDotGraph with agxbprint X-Git-Tag: 2.46.0~20^2^2~77^2~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1dc79b5c539d4708b59ed7fccea6eb8532bd85b0;p=graphviz simplify makeDotGraph with agxbprint --- diff --git a/cmd/tools/mm2gv.c b/cmd/tools/mm2gv.c index 9a05109d3..9ce50baff 100644 --- a/cmd/tools/mm2gv.c +++ b/cmd/tools/mm2gv.c @@ -259,14 +259,7 @@ static Agraph_t *makeDotGraph(SparseMatrix A, char *name, int dim, } agxbinit (&xb, BUFS, string); if (with_label) { - agxbput (&xb, name); - agxbput (&xb, ". "); - sprintf(buf, "%d", A->m); - agxbput (&xb, buf); - agxbput (&xb, " nodes, "); - sprintf(buf, "%d", A->nz); - agxbput (&xb, buf); - agxbput (&xb, " edges."); + agxbprint (&xb, "%s. %d nodes, %d edges.", name, A->m, A->nz); agattr(g, AGRAPH, "label", agxbuse (&xb)); }