mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
fix assert triggered when called isspace
This commit is contained in:
parent
533ba9824b
commit
f077960aa6
@ -26,7 +26,7 @@ static void SourceData__ctor(struct SourceData* self,
|
|||||||
self->source = c11_sbuf__submit(&ss);
|
self->source = c11_sbuf__submit(&ss);
|
||||||
// remove trailing newline
|
// remove trailing newline
|
||||||
int last_index = self->source->size - 1;
|
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--;
|
last_index--;
|
||||||
}
|
}
|
||||||
if(last_index >= 0) {
|
if(last_index >= 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user