From 8d73a9f8b78d9d847064399a428345839acca7dc Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 11 Oct 2023 01:10:34 -0500 Subject: [PATCH] Allow the UTF-8 splitting loop to be interrupted --- src/InputStream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/InputStream.c b/src/InputStream.c index 73cd570..9755ec3 100644 --- a/src/InputStream.c +++ b/src/InputStream.c @@ -570,7 +570,7 @@ static void inputSendThreadProc(void* context) { // We send each Unicode code point individually. This way we can always ensure they will // never straddle a packet boundary (which will cause a parsing error on the host). - while (i < totalLength) { + while (i < totalLength && !PltIsThreadInterrupted(&inputSendThread)) { uint32_t codePointLength; uint8_t firstByte = (uint8_t)holder->packet.unicode.text[i]; if ((firstByte & 0x80) == 0x00) {