mirror of
https://github.com/tmate-io/tmate.git
synced 2026-07-28 13:23:50 +00:00
Fix printing commands with no arguments, from Benjamin Poirier.
This commit is contained in:
parent
e8dff68588
commit
5cbca2e70f
1 changed files with 3 additions and 4 deletions
7
cmd.c
7
cmd.c
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue