]> granicus.if.org Git - graphviz/commitdiff
Fix uninitialized variable warning
authorerg <devnull@localhost>
Fri, 23 Jun 2006 17:45:03 +0000 (17:45 +0000)
committererg <devnull@localhost>
Fri, 23 Jun 2006 17:45:03 +0000 (17:45 +0000)
lib/neatogen/neatoinit.c

index b584b09027da0e6a77ec0950eae5c2e4bc5e8f97..3d605f06194db1d59dd9ab340e9a8337a2f25399 100644 (file)
@@ -1023,7 +1023,7 @@ setSeed (graph_t * G, int dflt, long* seedp)
 {
     char smallbuf[32];
     char *p = agget(G, "start");
-    int init;
+    int init = dflt;
 
     if (!p || (*p == '\0')) return dflt;
     if (isalpha(*(unsigned char *)p)) {
@@ -1039,6 +1039,10 @@ setSeed (graph_t * G, int dflt, long* seedp)
        }
        else init = dflt;
     }
+    else if (isdigit(*(unsigned char *)p)) {
+       init = INIT_RANDOM;
+    }
+    
     if (init == INIT_RANDOM) {
        long seed;
        /* Check for seed value */