MOD: Corrected condition in getSon to handle the root of the taxonomy

git-svn-id: https://www.grenoble.prabi.fr/svn/LECASofts/ecoPCR/trunk@422 60f365c0-8329-0410-b2a4-ec073aeeaa1d
This commit is contained in:
Frédéric Boyer
2012-05-16 07:52:28 +00:00
parent e2fe83fcb7
commit 745d50cfa4
2 changed files with 6 additions and 4 deletions

View File

@ -12,7 +12,7 @@
static void printresult(ecotx_t *taxon,econame_t* name,ecotaxonomy_t *taxonomy)
{
char* rankname;
char* classname;
char* classname;
char* matchedname=taxon->name;
classname="scientific name";
@ -45,6 +45,7 @@ static void printheader(void)
"scientific name");
}
/**
* display son's list for given taxon
**/
@ -57,7 +58,8 @@ static void get_son(ecotaxonomy_t *taxonomy, ecotx_t *taxon, int32_t *count, cha
i < taxonomy->taxons->count;
i++, current_taxon++)
{
if (taxon->taxid == current_taxon->parent->taxid)
if (taxon != current_taxon && taxon->taxid == current_taxon->parent->taxid)
{
if (rankname == NULL || !strcmp(rankname,taxonomy->ranks->label[current_taxon->rank]))
{