From 3856a6310d2d0c12ebb4b40ae6ada16d3f07693b Mon Sep 17 00:00:00 2001 From: Luke Butler Date: Wed, 15 Feb 2023 14:46:39 -0500 Subject: [PATCH] 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. --- src/input3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/input3.c b/src/input3.c index 082655a..10511a6 100644 --- a/src/input3.c +++ b/src/input3.c @@ -922,7 +922,7 @@ int controldata(Project *pr) case TIMER: case TIMEOFDAY: 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); break; case LOWLEVEL: