1
0
mirror of https://github.com/tmate-io/tmate-ssh-server.git synced 2020-11-18 19:53:51 -08:00

Sync OpenBSD patchset 1095:

Fix printing commands with no arguments, from Benjamin Poirier.
This commit is contained in:
Tiago Cunha 2012-04-24 16:18:35 +00:00
parent bdfbb52951
commit 31cf5314ee

5
cmd.c
View File

@ -303,12 +303,11 @@ 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';
}
}
return (off);
}