mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
Merge pull request #349 from lightovernight/fix-pirntchar
fix: ensure isprint() receives unsigned char to prevent MSVC debug as…
This commit is contained in:
commit
e84f86b2de
@ -103,7 +103,7 @@ void c11_sbuf__write_quoted(c11_sbuf* self, c11_sv sv, char quote) {
|
|||||||
if(i + u8bytes > sv.size) u8bytes = 0; // invalid utf8
|
if(i + u8bytes > sv.size) u8bytes = 0; // invalid utf8
|
||||||
if(u8bytes <= 1) {
|
if(u8bytes <= 1) {
|
||||||
// not a valid utf8 char, or ascii
|
// not a valid utf8 char, or ascii
|
||||||
if(!isprint(c)) {
|
if(!isprint((unsigned char)c)) {
|
||||||
unsigned char uc = (unsigned char)c;
|
unsigned char uc = (unsigned char)c;
|
||||||
c11_sbuf__write_cstrn(self, "\\x", 2);
|
c11_sbuf__write_cstrn(self, "\\x", 2);
|
||||||
c11_sbuf__write_char(self, PK_HEX_TABLE[uc >> 4]);
|
c11_sbuf__write_char(self, PK_HEX_TABLE[uc >> 4]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user