From 39b36beb791714bcd99037a4b7caab0c20cd8755 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Sat, 22 Mar 2025 21:35:47 -0500 Subject: [PATCH] Don't add null characters to the expect buffer They prevent regexec() from seeing the remainder of the buffer. --- src/script.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/script.c b/src/script.c index f6023eb..b471932 100644 --- a/src/script.c +++ b/src/script.c @@ -207,6 +207,11 @@ static int write_(lua_State *L) // Function to add a character to the circular expect buffer static void expect_buffer_add(char c) { + if (!c) + { + return; + } + if (buffer_size < MAX_BUFFER_SIZE) { circular_buffer[buffer_size++] = c;