From: Matthew Fernandez <matthew.fernandez@gmail.com>
Date: Sat, 24 Apr 2021 04:27:15 +0000 (-0700)
Subject: remove dead writes to buf
X-Git-Tag: 2.47.2~13^2~6
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f8fa0225f0f9e26f50dd50d0aa46adafbb38548f;p=graphviz

remove dead writes to buf

It's unclear what the intention of this code was. It writes data to buf that is
then never read.
---

diff --git a/lib/sparse/DotIO.c b/lib/sparse/DotIO.c
index 57d924964..100ea2846 100644
--- a/lib/sparse/DotIO.c
+++ b/lib/sparse/DotIO.c
@@ -540,17 +540,6 @@ makeDotGraph (SparseMatrix A, char *name, int dim, real *x, int with_color, int
     for (j = ia[i]; j < ia[i+1]; j++) {
       h = arr [ja[j]];
       if (val){
-	switch (A->type){
-	case MATRIX_TYPE_REAL:
-	  snprintf(buf, sizeof(buf), "%f", ((real*)A->a)[j]);
-	  break;
-	case MATRIX_TYPE_INTEGER:
-	  snprintf(buf, sizeof(buf), "%d", ((int*)A->a)[j]);
-	  break;
-	case MATRIX_TYPE_COMPLEX:/* take real part as weight */
-	  snprintf(buf, sizeof(buf), "%f", ((real*)A->a)[2*j]);
-	  break;
-	}
 	if (with_color) {
           if (i != ja[j]){
             snprintf(buf2, sizeof(buf2), "%s", hue2rgb(.65*color[j], cstring));
@@ -559,7 +548,6 @@ makeDotGraph (SparseMatrix A, char *name, int dim, real *x, int with_color, int
           }
         }
       } else {
-	snprintf(buf, sizeof(buf), "%f", 1.);
         if (with_color) {
           if (i != ja[j]){
             snprintf(buf2, sizeof(buf2), "%s", hue2rgb(.65*color[j], cstring));