X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fgraph.c;h=203942dbdf2ec9d5e9427ed77d262266025dfb70;hp=586aee8b738e67a6627590188fbfe743304a4f24;hb=c9c3cc03bfec664f7386011f3fc608d1c0844836;hpb=8f1ba6daebb515d4e82c30d9b3578ea55de9c99a diff --git a/src/graph.c b/src/graph.c index 586aee8b..203942db 100644 --- a/src/graph.c +++ b/src/graph.c @@ -1,6 +1,6 @@ /* graph.c -- graph algorithms - Copyright (C) 2001-2012 Guus Sliepen , + Copyright (C) 2001-2013 Guus Sliepen , 2001-2005 Ivo Timmermans This program is free software; you can redistribute it and/or modify @@ -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);