Merge pull request #52 from ihh/master

Fixed output bug where leaf branch length is not printed
This commit is contained in:
Heng Li 2015-06-26 15:27:38 -04:00
commit c5c637a3a9

8
knhx.c
View File

@ -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