summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-list-keys.c
diff options
context:
space:
mode:
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);
}