Correct token replacement issue

This commit is contained in:
Tristan Penman 2022-10-26 21:01:58 +11:00
parent c4355eaa47
commit 78ac8a737d
2 changed files with 2 additions and 2 deletions

View File

@ -2708,7 +2708,7 @@ inline std::string extractReferenceToken(std::string::const_iterator begin,
try {
#endif
const char c = decodePercentEncodedChar(token.substr(n + 1, 2));
token.replace(n, 3, &c, 1);
token.replace(n, 3, 1, c);
#if VALIJSON_USE_EXCEPTIONS
} catch (const std::runtime_error &e) {
throwRuntimeError(

View File

@ -111,7 +111,7 @@ inline std::string extractReferenceToken(std::string::const_iterator begin,
try {
#endif
const char c = decodePercentEncodedChar(token.substr(n + 1, 2));
token.replace(n, 3, &c, 1);
token.replace(n, 3, 1, c);
#if VALIJSON_USE_EXCEPTIONS
} catch (const std::runtime_error &e) {
throwRuntimeError(