Update epanet.c
Trying to isolate bug
This commit is contained in:
@@ -2861,22 +2861,18 @@ int DLLEXPORT EN_getdemandname(EN_Project p, int nodeIndex, int demandIndex,
|
|||||||
|
|
||||||
// Locate demand category record and retrieve its name
|
// Locate demand category record and retrieve its name
|
||||||
list_t *dlist = p->network.Node[nodeIndex].D;
|
list_t *dlist = p->network.Node[nodeIndex].D;
|
||||||
|
if (dlist) {
|
||||||
list_node_t *lnode = get_nth_list(dlist, demandIndex);
|
list_node_t *lnode = get_nth_list(dlist, demandIndex);
|
||||||
if (!lnode)
|
if (!lnode)
|
||||||
return 253;
|
return 253;
|
||||||
else
|
else
|
||||||
temp = get_category_name(lnode);
|
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) {
|
if (temp) {
|
||||||
strcpy(demandName, temp);
|
strcpy(demandName, temp);
|
||||||
//else demandName[0] = '\0';
|
|
||||||
free(temp);
|
free(temp);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user