mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-12 18:10:27 +01:00
Fix uninitialized value detected by valgrind
Fix issue reported in https://github.com/open-source-parsers/jsoncpp/issues/578 For std::string variable, length() is more readable than size().
This commit is contained in:
parent
6062f9b848
commit
9006194139
@ -103,7 +103,7 @@ Reader::Reader(const Features& features)
|
||||
|
||||
bool
|
||||
Reader::parse(const std::string& document, Value& root, bool collectComments) {
|
||||
JSONCPP_STRING documentCopy(document.data(), document.data() + document.capacity());
|
||||
JSONCPP_STRING documentCopy(document.data(), document.data() + document.length());
|
||||
std::swap(documentCopy, document_);
|
||||
const char* begin = document_.c_str();
|
||||
const char* end = begin + document_.length();
|
||||
|
Loading…
Reference in New Issue
Block a user