Fix bogus assert. 0x10ffff is a valid code point

This commit is contained in:
2025-06-24 15:48:16 -04:00
parent a8aab0187e
commit 2e803b5a76

View File

@@ -571,7 +571,7 @@ inline PRESERVE_NONE WeaselJsonStatus n_string2(Parser3 *self, char *buf,
return WeaselJson_REJECT; return WeaselJson_REJECT;
} }
buf += 6; buf += 6;
assert(codepoint < 0x10ffff); assert(codepoint <= 0x10ffff);
self->writeBuf[3] = (0b00111111 & codepoint) | 0b10000000; self->writeBuf[3] = (0b00111111 & codepoint) | 0b10000000;
codepoint >>= 6; codepoint >>= 6;
self->writeBuf[2] = (0b00111111 & codepoint) | 0b10000000; self->writeBuf[2] = (0b00111111 & codepoint) | 0b10000000;