From: Matthew Fernandez Date: Sat, 24 Apr 2021 04:20:27 +0000 (-0700) Subject: abbreviate construction of label_string X-Git-Tag: 2.47.2~13^2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=31511706ee133071c17af9bd72a4acfb15b6782b;p=graphviz abbreviate construction of label_string --- diff --git a/lib/sparse/DotIO.c b/lib/sparse/DotIO.c index 1a4e0ee1f..57d924964 100644 --- a/lib/sparse/DotIO.c +++ b/lib/sparse/DotIO.c @@ -437,15 +437,8 @@ makeDotGraph (SparseMatrix A, char *name, int dim, real *x, int with_color, int g = agopen ("G", Agdirected, 0); } - label_string = strcpy(label_string, name); - label_string = strcat(label_string, ". "); - snprintf(buf, sizeof(buf), "%d", A->m); - label_string = strcat(label_string, buf); - label_string = strcat(label_string, " nodes, "); - snprintf(buf, sizeof(buf), "%d", A->nz); - label_string = strcat(label_string, buf); - label_string = strcat(label_string, " edges."); - + snprintf(label_string, sizeof(label_string), "%s. %d nodes, %d edges.", name, + A->m, A->nz); if (with_label) agattr(g, AGRAPH, "label", label_string); agattr(g, AGRAPH, "fontcolor", "#808090");