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:
Alex Sinske
2020-08-05 18:43:17 +02:00
parent 80b30272cb
commit 32732dbdd5
3 changed files with 5 additions and 2 deletions

View File

@@ -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++;