Avoid getline(s, EOF)

Fixes #1288
This commit is contained in:
Christopher Dunn 2021-05-05 00:27:30 -05:00
parent bb34617267
commit ed1ab7ac45

View File

@ -104,8 +104,7 @@ bool Reader::parse(std::istream& is, Value& root, bool collectComments) {
// Since String is reference-counted, this at least does not // Since String is reference-counted, this at least does not
// create an extra copy. // create an extra copy.
String doc; String doc(std::istreambuf_iterator<char>(is), {});
std::getline(is, doc, static_cast<char> EOF);
return parse(doc.data(), doc.data() + doc.size(), root, collectComments); return parse(doc.data(), doc.data() + doc.size(), root, collectComments);
} }