Second parameter is end pointer, not size

This commit is contained in:
Nathan Burles 2016-09-02 12:51:28 +01:00
parent 6f62821573
commit 6638883d9d
1 changed files with 1 additions and 1 deletions

View File

@ -60,7 +60,7 @@ void ANTLRInputStream::load(const std::string &input) {
// Remove the UTF-8 BOM if present.
const char bom[4] = "\xef\xbb\xbf";
if (input.compare(0, 3, bom, 3) == 0)
_data = antlrcpp::utfConverter.from_bytes(input.data() + 3, input.data() + input.size() - 3);
_data = antlrcpp::utfConverter.from_bytes(input.data() + 3, input.data() + input.size());
else
_data = antlrcpp::utfConverter.from_bytes(input);
p = 0;