summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2014-03-31 21:32:31 +0000
committernicm <nicm@openbsd.org>2014-03-31 21:32:31 +0000
commit7184a3d6f08c68049e95399512e11d3cefa43f49 (patch)
tree50df0450457c8c2fd8b62b4755a1c46dda459892 /usr.bin/tmux/cmd.c
parentChange secondary device attributes response to \033[>84;0;0c which is (diff)
downloadwireguard-openbsd-7184a3d6f08c68049e95399512e11d3cefa43f49.tar.xz
wireguard-openbsd-7184a3d6f08c68049e95399512e11d3cefa43f49.zip
Don't write into buffer if no arguments, reported by Filipe Rosset.
Diffstat (limited to 'usr.bin/tmux/cmd.c')
-rw-r--r--usr.bin/tmux/cmd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/tmux/cmd.c b/usr.bin/tmux/cmd.c
index 4d77dc3aca9..63e262699b1 100644
--- a/usr.bin/tmux/cmd.c
+++ b/usr.bin/tmux/cmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd.c,v 1.90 2014/01/09 14:20:55 nicm Exp $ */
+/* $OpenBSD: cmd.c,v 1.91 2014/03/31 21:32:31 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -139,6 +139,9 @@ cmd_pack_argv(int argc, char **argv, char *buf, size_t len)
size_t arglen;
int i;
+ if (argc == 0)
+ return (0);
+
*buf = '\0';
for (i = 0; i < argc; i++) {
if (strlcpy(buf, argv[i], len) >= len)