Permalink
Browse files

Fixed output bug where branch length is not printed on branches to le…

…af nodes
  • Loading branch information...
1 parent 5d449bc commit 7874e45779408174de8e5c8607ed80563819f452 @ihh ihh committed Jun 26, 2015
Showing with 7 additions and 1 deletion.
  1. +7 −1 knhx.c
View
8 knhx.c
@@ -133,7 +133,13 @@ static void format_node_recur(const knhx1_t *node, const knhx1_t *p, kstring_t *
sprintf(numbuf, ":%g", p->d);
kputsn(numbuf, strlen(numbuf), s);
}
- } else kputsn(p->name, strlen(p->name), s);
+ } else {
+ kputsn(p->name, strlen(p->name), s);
+ if (p->d >= 0) {
+ sprintf(numbuf, ":%g", p->d);
+ kputsn(numbuf, strlen(numbuf), s);
+ }
+ }
}
void kn_format(const knhx1_t *node, int root, kstring_t *s) // TODO: get rid of recursion

0 comments on commit 7874e45

Please sign in to comment.