diff options
author | 2013-05-15 15:34:09 +0000 | |
---|---|---|
committer | 2013-05-15 15:34:09 +0000 | |
commit | e855e3606b70750e9851f52b2beba099e2e9f2e7 (patch) | |
tree | ecf06b77bf0f8abc6bced178aba77716fbf4959d | |
parent | RIS should reset focus reporting, from Hayaki Saito. (diff) | |
download | wireguard-openbsd-e855e3606b70750e9851f52b2beba099e2e9f2e7.tar.xz wireguard-openbsd-e855e3606b70750e9851f52b2beba099e2e9f2e7.zip |
Reserve space for \0 in cmd_print, from George Nachman.
-rw-r--r-- | usr.bin/tmux/cmd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd.c b/usr.bin/tmux/cmd.c index b92b61a771c..000e2ee7210 100644 --- a/usr.bin/tmux/cmd.c +++ b/usr.bin/tmux/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.84 2013/03/25 11:53:54 nicm Exp $ */ +/* $OpenBSD: cmd.c,v 1.85 2013/05/15 15:34:09 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -295,8 +295,8 @@ cmd_print(struct cmd *cmd, char *buf, size_t len) size_t off, used; off = xsnprintf(buf, len, "%s ", cmd->entry->name); - if (off < len) { - used = args_print(cmd->args, buf + off, len - off); + if (off + 1 < len) { + used = args_print(cmd->args, buf + off, len - off - 1); if (used == 0) off--; else |