Skip to content

Commit 9edd6f8

Browse files
AdamKorczaisk
andauthored
Update Parser/tokenizer/helpers.c
Co-authored-by: AN Long <aisk@users.noreply.github.com>
1 parent 8eba1c7 commit 9edd6f8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Parser/tokenizer/helpers.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,9 +494,11 @@ valid_utf8(const unsigned char* s)
494494
return 0;
495495
}
496496
length = expected + 1;
497-
for (int i = 1; i <= expected; i++)
498-
if (s[i] < 0x80 || s[i] >= 0xC0)
497+
for (int i = 1; i <= expected; i++) {
498+
if (s[i] < 0x80 || s[i] >= 0xC0) {
499499
return 0;
500+
}
501+
}
500502
return length;
501503
}
502504

0 commit comments

Comments
 (0)