From d0e95c5fba517f2468dc7bed5ce90063d22e3fed Mon Sep 17 00:00:00 2001 From: Davis C Date: Wed, 17 Apr 2024 11:06:41 -0500 Subject: [PATCH] Reset buffer size at start of expect --- src/script.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/script.c b/src/script.c index 6b99ec2..41a415b 100644 --- a/src/script.c +++ b/src/script.c @@ -265,6 +265,9 @@ static int expect(lua_State *L) int ret = 0; char c; + // Resets buffer to ignore previous `expect` calls + buffer_size = 0; + if ((string == NULL) || (timeout < 0)) { ret = -1;