1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-27 00:41:05 +03:00

🐛 fixing #575

I forgot to consider the offset.
This commit is contained in:
Niels Lohmann
2017-05-07 13:41:48 +02:00
parent 56ac7908f1
commit fba1bcdd0b
2 changed files with 7 additions and 1 deletions

View File

@ -8915,7 +8915,7 @@ class basic_json
{
// avoid reading too many characters
const size_t max_length = static_cast<size_t>(limit - start);
return std::string(start + offset, std::min({length, max_length}));
return std::string(start + offset, std::min({length, max_length - offset}));
}
private: