Commit dfc49e7a authored by Niels Lohmann's avatar Niels Lohmann

🐛 fixed a bug if parser was called with a stream at EOF (#367)

parent e3450cac
...@@ -8743,8 +8743,11 @@ basic_json_parser_66: ...@@ -8743,8 +8743,11 @@ basic_json_parser_66:
// append n characters to make sure that there is sufficient // append n characters to make sure that there is sufficient
// space between m_cursor and m_limit // space between m_cursor and m_limit
m_line_buffer.append(1, '\x00'); m_line_buffer.append(1, '\x00');
if (n > 0)
{
m_line_buffer.append(n - 1, '\x01'); m_line_buffer.append(n - 1, '\x01');
} }
}
else else
{ {
// delete processed characters from line buffer // delete processed characters from line buffer
......
...@@ -7892,8 +7892,11 @@ class basic_json ...@@ -7892,8 +7892,11 @@ class basic_json
// append n characters to make sure that there is sufficient // append n characters to make sure that there is sufficient
// space between m_cursor and m_limit // space between m_cursor and m_limit
m_line_buffer.append(1, '\x00'); m_line_buffer.append(1, '\x00');
if (n > 0)
{
m_line_buffer.append(n - 1, '\x01'); m_line_buffer.append(n - 1, '\x01');
} }
}
else else
{ {
// delete processed characters from line buffer // delete processed characters from line buffer
......
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