Fixes incorrect hour set with >9 input tokens

If you create a simple control with nine or more input tokens, the logic skips over assigning the hour variable and EPANET will activate the control at hour zero.
This commit is contained in:
Luke Butler
2023-02-15 14:46:39 -05:00
parent 8d8ccafad6
commit 3856a6310d

View File

@@ -922,7 +922,7 @@ int controldata(Project *pr)
case TIMER: case TIMER:
case TIMEOFDAY: case TIMEOFDAY:
if (n == 6) time = hour(parser->Tok[5], ""); if (n == 6) time = hour(parser->Tok[5], "");
if (n == 7) time = hour(parser->Tok[5], parser->Tok[6]); if (n >= 7) time = hour(parser->Tok[5], parser->Tok[6]);
if (time < 0.0) return setError(parser, 5, 213); if (time < 0.0) return setError(parser, 5, 213);
break; break;
case LOWLEVEL: case LOWLEVEL: