Update epanet.c

Trying to isolate bug
This commit is contained in:
michaeltryby
2019-04-22 11:07:01 -04:00
parent b80b4ed09c
commit 97f70e445d

View File

@@ -2861,22 +2861,18 @@ int DLLEXPORT EN_getdemandname(EN_Project p, int nodeIndex, int demandIndex,
// Locate demand category record and retrieve its name
list_t *dlist = p->network.Node[nodeIndex].D;
if (dlist) {
list_node_t *lnode = get_nth_list(dlist, demandIndex);
if (!lnode)
return 253;
else
temp = get_category_name(lnode);
//for (d = p->network.Node[nodeIndex].D;
// n < demandIndex && d->next != NULL; d = d->next) n++;
//if (n != demandIndex) return 253;
if (temp) {
strcpy(demandName, temp);
//else demandName[0] = '\0';
free(temp);
}
}
return 0;
}