From 31511706ee133071c17af9bd72a4acfb15b6782b Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Fri, 23 Apr 2021 21:20:27 -0700 Subject: [PATCH] abbreviate construction of label_string --- lib/sparse/DotIO.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) 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"); -- 2.40.0