Commit 6232c78f by Niels

possible fix

parent 1bbde459
...@@ -2412,10 +2412,12 @@ class basic_json ...@@ -2412,10 +2412,12 @@ class basic_json
/// constructor for strings /// constructor for strings
inline parser(const std::string& s) : buffer(s) inline parser(const std::string& s) : buffer(s)
{ {
buffer += " ";
// set buffer for RE2C // set buffer for RE2C
buffer_re2c = reinterpret_cast<const lexer_char_t*>(buffer.c_str()); buffer_re2c = reinterpret_cast<const lexer_char_t*>(buffer.c_str());
// set a pointer past the end of the buffer // set a pointer past the end of the buffer
buffer_re2c_limit = buffer_re2c + buffer.size(); buffer_re2c_limit = buffer_re2c + buffer.size() - 5;
// read first token // read first token
get_token(); get_token();
} }
...@@ -2430,10 +2432,12 @@ class basic_json ...@@ -2430,10 +2432,12 @@ class basic_json
buffer += input_line; buffer += input_line;
} }
buffer += " ";
// set buffer for RE2C // set buffer for RE2C
buffer_re2c = reinterpret_cast<const lexer_char_t*>(buffer.c_str()); buffer_re2c = reinterpret_cast<const lexer_char_t*>(buffer.c_str());
// set a pointer past the end of the buffer // set a pointer past the end of the buffer
buffer_re2c_limit = buffer_re2c + buffer.size(); buffer_re2c_limit = buffer_re2c + buffer.size() - 5;
// read first token // read first token
get_token(); get_token();
} }
......
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