-
-
Notifications
You must be signed in to change notification settings - Fork 184
Closed
Description
Describe the bug
We use "json_string_reader" to verify the validity of JSON. However, for some strings(e.g. empty string, string with all blanks, \t \n ), no error is reported.
Enumerate the steps to reproduce the bug
std::vector<std::string> vec{"", " ", " \t ", " \n "};
for(const auto& str : vec) {
jsoncons::json_string_reader reader(str);
std::error_code ec;
reader.read(ec);
reader.check_done();
if (ec) {
std::cout << ec.message() << " ";
} else {
std::cout << "OK ";
}
try {
jsoncons::json::parse(str);
std::cout << "OK ";
} catch (...) {
std::cout << "err ";
}
std::cout << "\n";
}
What is the expected behavior?
The expected result is that the "json_string_reader" can return an error.
What jsoncons library version?
- Latest release 0.178.0
- Other release ______
- master