From f077960aa69eee29d9d45fcf007ef4fcc821db01 Mon Sep 17 00:00:00 2001 From: lightovernight Date: Tue, 26 Aug 2025 18:09:47 +0800 Subject: [PATCH] fix assert triggered when called isspace --- src/common/sourcedata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/sourcedata.c b/src/common/sourcedata.c index c3a6c1eb..aff54ff0 100644 --- a/src/common/sourcedata.c +++ b/src/common/sourcedata.c @@ -26,7 +26,7 @@ static void SourceData__ctor(struct SourceData* self, self->source = c11_sbuf__submit(&ss); // remove trailing newline int last_index = self->source->size - 1; - while(last_index >= 0 && isspace(self->source->data[last_index])) { + while(last_index >= 0 && isspace((unsigned char)self->source->data[last_index])) { last_index--; } if(last_index >= 0) {