summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-list-keys.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2019-10-14 09:16:48 +0000
committernicm <nicm@openbsd.org>2019-10-14 09:16:48 +0000
commitf382be73cc9c42315733a3bdc8b53e5db9a5eaee (patch)
tree26cbc32b7df00dc18f0991ce1b0dd92da0a420fb /usr.bin/tmux/cmd-list-keys.c
parentMemory leaks, from Igor Wong in GitHub issue 1934. (diff)
downloadwireguard-openbsd-f382be73cc9c42315733a3bdc8b53e5db9a5eaee.tar.xz
wireguard-openbsd-f382be73cc9c42315733a3bdc8b53e5db9a5eaee.zip
Some old tmux versions can sometimes generate layout strings which have
the incorrect size for the top cell. Previously tmux didn't care but now that panes can be partly hidden, the size matters and is checked more strictly. So add some code to fix up the most common problem and a sanity check to reject layouts with any other size problems. Reported by Aleksandrs Ledovskis in GitHub issue 1930.
Diffstat (limited to 'usr.bin/tmux/cmd-list-keys.c')
-rw-r--r--usr.bin/tmux/cmd-list-keys.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-list-keys.c b/usr.bin/tmux/cmd-list-keys.c
index 014a2a0cf13..53e53a4eba6 100644
--- a/usr.bin/tmux/cmd-list-keys.c
+++ b/usr.bin/tmux/cmd-list-keys.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-list-keys.c,v 1.48 2019/10/03 10:39:08 nicm Exp $ */
+/* $OpenBSD: cmd-list-keys.c,v 1.49 2019/10/14 09:16:48 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -125,7 +125,7 @@ cmd_list_keys_exec(struct cmd *self, struct cmdq_item *item)
cp = utf8_padcstr(table->name, tablewidth);
cplen = strlen(cp) + 1;
- while (tmpused + cplen + 1>= tmpsize) {
+ while (tmpused + cplen + 1 >= tmpsize) {
tmpsize *= 2;
tmp = xrealloc(tmp, tmpsize);
}