Skip to content

Commit 7874e45

Browse files
author
Ian Holmes
committed
Fixed output bug where branch length is not printed on branches to leaf nodes
1 parent 5d449bc commit 7874e45

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

knhx.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,13 @@ static void format_node_recur(const knhx1_t *node, const knhx1_t *p, kstring_t *
133133
sprintf(numbuf, ":%g", p->d);
134134
kputsn(numbuf, strlen(numbuf), s);
135135
}
136-
} else kputsn(p->name, strlen(p->name), s);
136+
} else {
137+
kputsn(p->name, strlen(p->name), s);
138+
if (p->d >= 0) {
139+
sprintf(numbuf, ":%g", p->d);
140+
kputsn(numbuf, strlen(numbuf), s);
141+
}
142+
}
137143
}
138144

139145
void kn_format(const knhx1_t *node, int root, kstring_t *s) // TODO: get rid of recursion

0 commit comments

Comments
 (0)