mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 20:57:00 +00:00
Make options_tostring allocate its result instead of using a stack
buffer (needed for something in the future).
This commit is contained in:
@ -162,8 +162,8 @@ cmd_show_options_print(struct cmd *self, struct cmdq_item *item,
|
||||
struct options_entry *o, int idx)
|
||||
{
|
||||
struct options_array_item *a;
|
||||
const char *name, *value;
|
||||
char *tmp, *escaped;
|
||||
const char *name;
|
||||
char *value, *tmp, *escaped;
|
||||
|
||||
if (idx != -1) {
|
||||
xasprintf(&tmp, "%s[%d]", options_name(o), idx);
|
||||
@ -191,6 +191,7 @@ cmd_show_options_print(struct cmd *self, struct cmdq_item *item,
|
||||
free(escaped);
|
||||
} else
|
||||
cmdq_print(item, "%s %s", name, value);
|
||||
free(value);
|
||||
|
||||
free(tmp);
|
||||
}
|
||||
|
Reference in New Issue
Block a user