From 7bf18a744c84a14f9942fba6bdc2e1f6bd02d09a Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Sat, 12 Nov 2022 11:39:32 +0000 Subject: [PATCH] Tweaked bounds check --- repl/lib_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repl/lib_timer.c b/repl/lib_timer.c index 24779ef..efb2426 100644 --- a/repl/lib_timer.c +++ b/repl/lib_timer.c @@ -129,7 +129,7 @@ static int nativeCreateTimer(Interpreter* interpreter, LiteralArray* arguments) return -1; } - if (AS_INTEGER(microsecondLiteral) <= -1000 * 1000 || AS_INTEGER(microsecondLiteral) >= 1000 * 1000) { + if (AS_INTEGER(microsecondLiteral) <= -1000 * 1000 || AS_INTEGER(microsecondLiteral) >= 1000 * 1000 || (AS_INTEGER(secondLiteral) != 0 && AS_INTEGER(microsecondLiteral) < 0) ) { interpreter->errorOutput("Microseconds out of range in createTimer\n"); freeLiteral(secondLiteral); freeLiteral(microsecondLiteral);