We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 31d0319 commit b3e1d27Copy full SHA for b3e1d27
lib/include/cpp-json/json.h
@@ -1301,7 +1301,7 @@ inline std::string escape_string(NS::string_view s, Options options) {
1301
if (shift_state.seen == 0) {
1302
1303
if ((ch & 0x80) == 0) {
1304
- switch (*it) {
+ switch (ch) {
1305
case '\"':
1306
r += "\\\"";
1307
break;
@@ -1327,13 +1327,13 @@ inline std::string escape_string(NS::string_view s, Options options) {
1327
r += "\\t";
1328
1329
default:
1330
- if(!isprint(*it)) {
+ if(!isprint(ch)) {
1331
r += "\\u";
1332
char buf[5];
1333
- snprintf(buf, sizeof(buf), "%04X", *it);
+ snprintf(buf, sizeof(buf), "%04X", ch);
1334
r += buf;
1335
} else {
1336
- r += *it;
+ r += static_cast<char>(ch);
1337
}
1338
1339
0 commit comments