Fix a compiler warning.
[oweals/tinc.git] / src / graph.c
index 586aee8b738e67a6627590188fbfe743304a4f24..cca0935029587cc20d2cafa3fddb992b9c4a5b10 100644 (file)
@@ -318,7 +318,7 @@ void dump_graph(void) {
        node_t *n;
        edge_t *e;
        char *filename = NULL, *tmpname = NULL;
-       FILE *file, *pipe;
+       FILE *file, *pipe = NULL;
        
        if(!graph_changed || !get_config_string(lookup_config(config_tree, "GraphDumpFile"), &filename))
                return;
@@ -356,7 +356,7 @@ void dump_graph(void) {
 
        fprintf(file, "}\n");   
        
-       if(filename[0] == '|') {
+       if(pipe) {
                pclose(pipe);
        } else {
                fclose(file);