From 3d0c1d4768feab9231d4112759134fb620bfb9fc Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 19 Aug 2024 08:29:16 +0000 Subject: [PATCH] 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. --- usr.bin/tmux/tty-keys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c index 9b0a1d12096..67b7f5844e1 100644 --- a/usr.bin/tmux/tty-keys.c +++ b/usr.bin/tmux/tty-keys.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty-keys.c,v 1.175 2024/07/12 11:21:18 nicm Exp $ */ +/* $OpenBSD: tty-keys.c,v 1.176 2024/08/19 08:29:16 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -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; -- 2.20.1