diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2012-04-22 05:24:05 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2012-04-22 05:24:05 +0000 |
commit | 5cbca2e70f146ea90748fcec6056babcf671ad3f (patch) | |
tree | b648bb20be8a70628856608bfa833a9be79c09db | |
parent | e8dff6858815eef50b5ed41c6346cf8d8bb113ee (diff) | |
download | rtmux-5cbca2e70f146ea90748fcec6056babcf671ad3f.tar.gz rtmux-5cbca2e70f146ea90748fcec6056babcf671ad3f.tar.bz2 rtmux-5cbca2e70f146ea90748fcec6056babcf671ad3f.zip |
Fix printing commands with no arguments, from Benjamin Poirier.
-rw-r--r-- | cmd.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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); } |