Restore nul check in u8_nextchar

This commit is contained in:
Henrik Rydgård
2024-01-15 10:45:19 +01:00
parent 69124fda96
commit 3e078abbaf
+1 -1
View File
@@ -214,7 +214,7 @@ uint32_t u8_nextchar(const char *s, int *index, size_t size) {
do {
ch = (ch << 6) + (unsigned char)s[i++];
sz++;
} while (i < size && ((s[i]) & 0xC0) == 0x80);
} while (i < size && s[i] && ((s[i]) & 0xC0) == 0x80);
*index = i;
return ch - offsetsFromUTF8[sz - 1];
}