diff --git a/README.md b/README.md index ea16f87..e142d81 100644 --- a/README.md +++ b/README.md @@ -205,7 +205,7 @@ Rendering routes with graphviz The `test_gvc_render_file` API let you render the whole route trie into a image. -![Imgur](http://i.imgur.com/ZwaDEAq.png) +![Imgur](http://i.imgur.com/hA8QXRi.png) Or you can even export it with dot format: diff --git a/src/gvc.c b/src/gvc.c index dc0aacd..b4669fe 100644 --- a/src/gvc.c +++ b/src/gvc.c @@ -23,8 +23,8 @@ void r3_tree_build_ag_nodes(Agraph_t * g, Agnode_t * ag_parent_node, const node node_cnt++; char *nodename = NULL; - if ( n->combined_pattern ) { - asprintf(&nodename,"%s", n->combined_pattern); + if ( e && e->child && e->child->combined_pattern ) { + asprintf(&nodename,"%s", e->child->combined_pattern); } else { asprintf(&nodename,"#%d", node_cnt); } diff --git a/src/str.c b/src/str.c index 98bc687..3219f73 100644 --- a/src/str.c +++ b/src/str.c @@ -74,6 +74,13 @@ char * r3_slug_to_str(r3_slug_t *s) { } +/* +r3_slug_t * r3_slug_parse_next(r3_slug_t *s) { + r3_slug_parse(s->end, s->path_len - (s->end - s->begin), s->end; +} +*/ + + r3_slug_t * r3_slug_parse(const char *needle, int needle_len, char **errstr) { r3_slug_t * s = r3_slug_new(needle, needle_len);