Fix (maybe) JSON escaping.
I've obviously never tested this code!
This commit is contained in:
parent
cae20a8060
commit
2a1a2a0a71
7
net_io.c
7
net_io.c
|
@ -712,12 +712,7 @@ static const char *jsonEscapeString(const char *str) {
|
||||||
*out++ = '\\';
|
*out++ = '\\';
|
||||||
*out++ = ch;
|
*out++ = ch;
|
||||||
} else if (ch < 32 || ch > 127) {
|
} else if (ch < 32 || ch > 127) {
|
||||||
*out++ = '\\';
|
out += snprintf(out, end - out, "\\u%04x", ch);
|
||||||
*out++ = 'u';
|
|
||||||
*out++ = '0';
|
|
||||||
*out++ = '0';
|
|
||||||
*out++ = (ch >> 4) & 0x0f;
|
|
||||||
*out++ = ch & 0x0f;
|
|
||||||
} else {
|
} else {
|
||||||
*out++ = ch;
|
*out++ = ch;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue