diff options
author | 2012-04-22 05:24:05 +0000 | |
---|---|---|
committer | 2012-04-22 05:24:05 +0000 | |
commit | 3435deaee73086611fe0a4d541da344519d9b0c3 (patch) | |
tree | e7f6fbf695e48641653450886f24b41041a8c872 /usr.bin/tmux/cmd.c | |
parent | Handle partial keys properly by making sure the timer has actually (diff) | |
download | wireguard-openbsd-3435deaee73086611fe0a4d541da344519d9b0c3.tar.xz wireguard-openbsd-3435deaee73086611fe0a4d541da344519d9b0c3.zip |
Fix printing commands with no arguments, from Benjamin Poirier.
Diffstat (limited to 'usr.bin/tmux/cmd.c')
-rw-r--r-- | usr.bin/tmux/cmd.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/tmux/cmd.c b/usr.bin/tmux/cmd.c index 08744ed651e..5b9ba25de01 100644 --- a/usr.bin/tmux/cmd.c +++ b/usr.bin/tmux/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.63 2012/03/03 08:31:18 nicm Exp $ */ +/* $OpenBSD: cmd.c,v 1.64 2012/04/22 05:24:05 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -304,11 +304,10 @@ cmd_print(struct cmd *cmd, char *buf, size_t len) if (off < len) { used = args_print(cmd->args, buf + off, len - off); if (used == 0) - buf[off - 1] = '\0'; - else { + off--; + else off += used; - buf[off] = '\0'; - } + buf[off] = '\0'; } return (off); } |