From d22f4cb856db361cc413a2f9bcd326404afa470e Mon Sep 17 00:00:00 2001 From: Quentin Rameau Date: Thu, 29 Nov 2018 00:17:12 +0100 Subject: [PATCH] Double-quote nodes in graphviz network file MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This is needed for all nodes with a name starting with a digit, otherwise the ID would be interpreted as a numeral. --- src/graph.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/graph.c b/src/graph.c index 3529d01..c63fdf9 100644 --- a/src/graph.c +++ b/src/graph.c @@ -360,13 +360,13 @@ void dump_graph(void) { /* dump all nodes first */ for(node = node_tree->head; node; node = node->next) { n = node->data; - fprintf(file, " %s [label = \"%s\"];\n", n->name, n->name); + fprintf(file, " \"%s\" [label = \"%s\"];\n", n->name, n->name); } /* now dump all edges */ for(node = edge_weight_tree->head; node; node = node->next) { e = node->data; - fprintf(file, " %s -> %s;\n", e->from->name, e->to->name); + fprintf(file, " \"%s\" -> \"%s\";\n", e->from->name, e->to->name); } fprintf(file, "}\n"); -- 2.25.1