diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-04-22 05:24:06 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-04-22 05:24:06 +0000 |
commit | 856ac2591baaf667bfcf163c7fbcb9f5a766137e (patch) | |
tree | bfbc93256b337eebf744b123f4a175fe82dde559 /usr.bin/tmux | |
parent | 505ddb64be21959e3aef2a7746b35191e4d061f2 (diff) |
Fix printing commands with no arguments, from Benjamin Poirier.
Diffstat (limited to 'usr.bin/tmux')
-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); } |