mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-08 01:04:06 +01:00
Fix printing commands with no arguments, from Benjamin Poirier.
This commit is contained in:
parent
e8dff68588
commit
5cbca2e70f
7
cmd.c
7
cmd.c
@ -304,11 +304,10 @@ cmd_print(struct cmd *cmd, char *buf, size_t len)
|
|||||||
if (off < len) {
|
if (off < len) {
|
||||||
used = args_print(cmd->args, buf + off, len - off);
|
used = args_print(cmd->args, buf + off, len - off);
|
||||||
if (used == 0)
|
if (used == 0)
|
||||||
buf[off - 1] = '\0';
|
off--;
|
||||||
else {
|
else
|
||||||
off += used;
|
off += used;
|
||||||
buf[off] = '\0';
|
buf[off] = '\0';
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return (off);
|
return (off);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user