diff options
Diffstat (limited to 'sys/libbio/phylo.c')
-rw-r--r-- | sys/libbio/phylo.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/libbio/phylo.c b/sys/libbio/phylo.c index 71901ba..d03bc48 100644 --- a/sys/libbio/phylo.c +++ b/sys/libbio/phylo.c @@ -51,18 +51,20 @@ phylo·rmchild(bio·Node* parent, bio·Node* child) error phylo·countnodes(bio·Node *node, int *n) { + int m; error err; bio·Node *child; - node->nnode = 0; + m = *n; for (child = node->child; child != nil; child = child->sibling) { - if (err = phylo·countnodes(child, &node->nnode), err) { + if (err = phylo·countnodes(child, n), err) { errorf("node count: failure at '%s'", child->name); return 1; } } + node->nnode = *n - m; + *n += 1; - *n += node->nnode + 1; return 0; } |