Commit 521da753 by Pedro J. Estébanez

Fix VariantParser::StreamString EOF determination

parent 47f19cc7
......@@ -51,10 +51,16 @@ bool VariantParser::StreamFile::is_eof() const {
CharType VariantParser::StreamString::get_char() {
if (pos >= s.length())
if (pos > s.length()) {
return 0;
else
} else if (pos == s.length()) {
// You need to try to read again when you have reached the end for EOF to be reported,
// so this works the same as files (like StreamFile does)
pos++;
return 0;
} else {
return s[pos++];
}
}
bool VariantParser::StreamString::is_utf8() const {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment