This solves the garbled error message and optionally adds an improved specific error message, which existed in EPANET 2.1 when a network has unconnected nodes. Another similar case in was code found and corrected with the same pattern, but could not be tested.
This commit is contained in:
@@ -146,6 +146,7 @@ int readdata(Project *pr)
|
||||
|
||||
char line[MAXLINE + 1], // Line from input data file
|
||||
wline[MAXLINE + 1]; // Working copy of input line
|
||||
char errmsg[MAXMSG + 1] = "";
|
||||
int sect, newsect, // Data sections
|
||||
errcode = 0, // Error code
|
||||
inperr, errsum; // Error code & total error count
|
||||
@@ -207,7 +208,7 @@ int readdata(Project *pr)
|
||||
// Check if max. line length exceeded
|
||||
if (strlen(line) >= MAXLINE)
|
||||
{
|
||||
sprintf(pr->Msg, "%s section: %s", geterrmsg(214, pr->Msg), SectTxt[sect]);
|
||||
sprintf(pr->Msg, "%s section: %s", geterrmsg(214, errmsg), SectTxt[sect]);
|
||||
writeline(pr, pr->Msg);
|
||||
writeline(pr, line);
|
||||
errsum++;
|
||||
|
||||
Reference in New Issue
Block a user