summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-list-keys.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2015-11-27 15:06:43 +0000
committernicm <nicm@openbsd.org>2015-11-27 15:06:43 +0000
commit8ae71cbb81e6a97f6b0f8f8f0ddba8c9837e743f (patch)
treefacedba4a31a3bcb326d5918ed3f195673c8cbf7 /usr.bin/tmux/cmd-list-keys.c
parentKeep lo(4) definitions inside if_loop.c (diff)
downloadwireguard-openbsd-8ae71cbb81e6a97f6b0f8f8f0ddba8c9837e743f.tar.xz
wireguard-openbsd-8ae71cbb81e6a97f6b0f8f8f0ddba8c9837e743f.zip
Do not set a limit on the length of commands when printing them.
Diffstat (limited to 'usr.bin/tmux/cmd-list-keys.c')
-rw-r--r--usr.bin/tmux/cmd-list-keys.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.bin/tmux/cmd-list-keys.c b/usr.bin/tmux/cmd-list-keys.c
index 5490326d944..d9f0f2cf49f 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.30 2015/11/18 14:27:44 nicm Exp $ */
+/* $OpenBSD: cmd-list-keys.c,v 1.31 2015/11/27 15:06:43 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -56,7 +56,6 @@ cmd_list_keys_exec(struct cmd *self, struct cmd_q *cmdq)
struct key_binding *bd;
const char *key, *tablename, *r;
char *cp, tmp[BUFSIZ];
- size_t used;
int repeat, width, tablewidth, keywidth;
if (self->entry == &cmd_list_commands_entry)
@@ -115,11 +114,9 @@ cmd_list_keys_exec(struct cmd *self, struct cmd_q *cmdq)
strlcat(tmp, " ", sizeof tmp);
free(cp);
- used = strlen(tmp);
- if (used < (sizeof tmp) - 1) {
- cmd_list_print(bd->cmdlist, tmp + used,
- (sizeof tmp) - used);
- }
+ cp = cmd_list_print(bd->cmdlist);
+ strlcat(tmp, cp, sizeof tmp);
+ free(cp);
cmdq_print(cmdq, "bind-key %s", tmp);
}