summaryrefslogtreecommitdiffstats
path: root/tty-keys.c
diff options
context:
space:
mode:
authornicm <nicm>2021-10-21 08:36:51 +0000
committernicm <nicm>2021-10-21 08:36:51 +0000
commit289ac55ebde18df237ad21734ba4056896d11022 (patch)
tree022c57716458da448676d925788fe5595dcb141b /tty-keys.c
parent7bd9cdf6fcf43e0edc8ab3a4accf2009ca5aa35e (diff)
Correctly adjust the end pointer for a two character terminator before
decoding OSC 52 response, from Daniel Ekloef in GitHub issue 2942.
Diffstat (limited to 'tty-keys.c')
-rw-r--r--tty-keys.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tty-keys.c b/tty-keys.c
index 6dfa70f3..65b600c0 100644
--- a/tty-keys.c
+++ b/tty-keys.c
@@ -1204,6 +1204,9 @@ tty_keys_clipboard(__unused struct tty *tty, const char *buf, size_t len,
buf += 5;
end -= 5;
+ /* Adjust end so that it points to the start of the terminator. */
+ end -= terminator - 1;
+
/* Get the second argument. */
while (end != 0 && *buf != ';') {
buf++;