Fix trace node id parser error

This commit is contained in:
Lew Rossman
2023-09-11 18:23:49 -04:00
parent e420380248
commit a2c0ff7889
3 changed files with 9 additions and 11 deletions

View File

@@ -7,7 +7,7 @@ Description: parses network data from a line of an EPANET input file
Authors: see AUTHORS
Copyright: see AUTHORS
License: see LICENSE
Last Updated: 02/05/2023
Last Updated: 09/11/2023
******************************************************************************
*/
@@ -1842,10 +1842,7 @@ int optionchoice(Project *pr, int n)
}
if (qual->Qualflag == TRACE)
{
// Copy Trace Node ID to parser->Tok[0] for error reporting
strcpy(parser->Tok[0], "");
if (n < 2) return 201;
strcpy(parser->Tok[0], parser->Tok[2]);
qual->TraceNode = findnode(net, parser->Tok[2]);
if (qual->TraceNode == 0) return setError(parser, 2, 212);
strncpy(qual->ChemName, u_PERCENT, MAXID);