summaryrefslogtreecommitdiff
path: root/lib/jsonParse.impl.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-05-01 17:28:44 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2021-11-07 16:41:37 +0000
commitfc8c9a6c7bec176299915c6adab120e1bf2ea4e9 (patch)
tree837426e53f3ec0cd06a6b7c9244c57a7c4229953 /lib/jsonParse.impl.cpp
parentFix the fact I've been spelling persistence wrong this whole time (diff)
downloadilt-fc8c9a6c7bec176299915c6adab120e1bf2ea4e9.tar.bz2
ilt-fc8c9a6c7bec176299915c6adab120e1bf2ea4e9.tar.xz
ilt-fc8c9a6c7bec176299915c6adab120e1bf2ea4e9.zip
Lots of test cases, few minor fixes
Diffstat (limited to 'lib/jsonParse.impl.cpp')
-rw-r--r--lib/jsonParse.impl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/jsonParse.impl.cpp b/lib/jsonParse.impl.cpp
index 3ed8e62..4d13eae 100644
--- a/lib/jsonParse.impl.cpp
+++ b/lib/jsonParse.impl.cpp
@@ -12,7 +12,7 @@ json::jsonParser::LexerError(const char * msg)
void
json::jsonParser::appendEscape(const char * cphs, std::string & str)
{
- appendEscape(std::strtoul(cphs, nullptr, 16), str);
+ appendEscape(std::strtoul(cphs + 1, nullptr, 16), str);
}
void
@@ -39,4 +39,7 @@ json::jsonParser::appendEscape(unsigned long cp, std::string & str)
str += char(((cp >> 6) & 63) + 128);
str += char((cp & 63) + 128);
}
+ else {
+ throw std::range_error("Invalid UTF-8 sequence");
+ }
}