Both terminators \007 and \033\\ leave the index pointing to the final

character of the terminator, so correct the size calculation to always
add one. GitHub issue 4082.
This commit is contained in:
nicm 2024-08-19 08:29:16 +00:00
parent 4008e2ff6d
commit 937ba1d8dd

View File

@ -1212,7 +1212,7 @@ tty_keys_clipboard(struct tty *tty, const char *buf, size_t len, size_t *size)
}
if (end == len)
return (1);
*size = end + terminator;
*size = end + 1;
/* Skip the initial part. */
buf += 5;