mirror of
https://github.com/tmux/tmux.git
synced 2025-01-14 20:58:53 +00:00
Reserve space for \0 in cmd_print, from George Nachman.
This commit is contained in:
parent
772d61f3ed
commit
25c430b1cd
4
cmd.c
4
cmd.c
@ -295,8 +295,8 @@ cmd_print(struct cmd *cmd, char *buf, size_t len)
|
||||
size_t off, used;
|
||||
|
||||
off = xsnprintf(buf, len, "%s ", cmd->entry->name);
|
||||
if (off < len) {
|
||||
used = args_print(cmd->args, buf + off, len - off);
|
||||
if (off + 1 < len) {
|
||||
used = args_print(cmd->args, buf + off, len - off - 1);
|
||||
if (used == 0)
|
||||
off--;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user