diff --git a/src/libecoPCR/ecotax.c b/src/libecoPCR/ecotax.c index 4da5142..813c490 100644 --- a/src/libecoPCR/ecotax.c +++ b/src/libecoPCR/ecotax.c @@ -208,12 +208,13 @@ int eco_isundertaxon(ecotx_t *taxon, ecotx_t *next_parent; next_parent = taxon->parent; - - while ( (other_taxid != next_parent->taxid) && (next_parent!=0) ) + + while ( (other_taxid != next_parent->taxid) && + (strcmp(next_parent->name, "root")) ) { next_parent = next_parent->parent; } - + if (other_taxid == next_parent->taxid) return 1; else