]> granicus.if.org Git - graphviz/commitdiff
use itos to remove an intermediate buffer
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 24 Apr 2021 04:30:16 +0000 (21:30 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 14 May 2021 00:03:36 +0000 (17:03 -0700)
lib/sparse/DotIO.c

index 100ea284665d656809500dbbd18b59074f635945..85d446f8c3d903f23963fc3bd5c2c626e01fe8c6 100644 (file)
@@ -415,7 +415,7 @@ makeDotGraph (SparseMatrix A, char *name, int dim, real *x, int with_color, int
   Agnode_t* h;
   Agedge_t* e;
   int i, j;
-  char buf[1024], buf2[1024];
+  char buf2[1024];
   Agsym_t *sym2 = NULL, *sym3 = NULL;
   int* ia=A->ia;
   int* ja=A->ja;
@@ -482,8 +482,7 @@ makeDotGraph (SparseMatrix A, char *name, int dim, real *x, int with_color, int
     sym3 = agattr(g, AGEDGE, "wt", ""); 
   }
   for (i = 0; i < A->m; i++) {
-    snprintf(buf, sizeof(buf), "%d", i);
-    n = mkNode (g, buf);
+    n = mkNode (g, itos(i).str);
     ND_id(n) = i;
     arr[i] = n;
   }