Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/core/StarJsonPath.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-27 20:23:44 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-27 20:23:44 +1000
commit332983c97b7a729c4dc5f19aa9ee4a22c420f7d8 (patch)
treefd9c441b796b522bdd5c7f8fbd32f51b8eff2a28 /source/core/StarJsonPath.cpp
parent14b9689b6d4f4ad5276c88130dc6e449bedc0709 (diff)
The Formatting String Catastrophe
Diffstat (limited to 'source/core/StarJsonPath.cpp')
-rw-r--r--source/core/StarJsonPath.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/core/StarJsonPath.cpp b/source/core/StarJsonPath.cpp
index 9eb5fae..c03e883 100644
--- a/source/core/StarJsonPath.cpp
+++ b/source/core/StarJsonPath.cpp
@@ -8,21 +8,21 @@ namespace JsonPath {
buffer.clear();
if (*iterator != '/')
- throw ParsingException::format("Missing leading '/' in Json pointer \"%s\"", path);
+ throw ParsingException::format("Missing leading '/' in Json pointer \"{}\"", path);
iterator++;
while (iterator != end && *iterator != '/') {
if (*iterator == '~') {
++iterator;
if (iterator == end)
- throw ParsingException::format("Incomplete escape sequence in Json pointer \"%s\"", path);
+ throw ParsingException::format("Incomplete escape sequence in Json pointer \"{}\"", path);
if (*iterator == '0')
buffer.append('~');
else if (*iterator == '1')
buffer.append('/');
else
- throw ParsingException::format("Invalid escape sequence in Json pointer \"%s\"", path);
+ throw ParsingException::format("Invalid escape sequence in Json pointer \"{}\"", path);
++iterator;
} else
buffer.append(*iterator++);
@@ -38,7 +38,7 @@ namespace JsonPath {
buffer.clear();
if (*iterator == '.') {
- throw ParsingException::format("Entry starts with '.' in query path \"%s\"", path);
+ throw ParsingException::format("Entry starts with '.' in query path \"{}\"", path);
} else if (*iterator == '[') {
// Parse array number and ']'
@@ -49,7 +49,7 @@ namespace JsonPath {
buffer.append(*iterator++);
if (iterator == end || *iterator != ']')
- throw ParsingException::format("Array has no trailing ']' or has invalid character in query path \"%s\"", path);
+ throw ParsingException::format("Array has no trailing ']' or has invalid character in query path \"{}\"", path);
// Consume trailing ']'
++iterator;