Fix the upper limit for the pending buffer

The pending buffer needs to be twice the max size of the read buffer.
This commit is contained in:
Kovid Goyal
2021-09-16 19:53:55 +05:30
parent e8e7ad3b75
commit e12246983b

View File

@@ -1529,7 +1529,7 @@ do_parse_bytes(Screen *screen, const uint8_t *read_buf, const size_t read_buf_sz
const size_t needed_space = read_buf_sz * 2;
screen->pending_mode.stop_escape_code_type = 0;
if (screen->pending_mode.capacity - screen->pending_mode.used < needed_space) {
if (screen->pending_mode.capacity >= READ_BUF_SZ) {
if (screen->pending_mode.capacity > READ_BUF_SZ * 2) {
dump_partial_escape_code_to_pending(screen);
screen->pending_mode.activated_at = 0;
state = START;