diff options
author | Brian Ashworth <[email protected]> | 2018-08-02 21:37:29 -0400 |
---|---|---|
committer | Brian Ashworth <[email protected]> | 2018-08-03 10:37:35 -0400 |
commit | a7f7d4a488c8d3b2461122765f9904c8a411a583 (patch) | |
tree | 7abee51265a8b9550c62255d0c6649935ee1d6a2 /sway/commands.c | |
parent | f9a6407111a8730df51258c3b07502814a8ab3e1 (diff) |
Write to swaynag pipe fd directly on config errors
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sway/commands.c b/sway/commands.c index 81e9ea42..364c26da 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -132,6 +132,7 @@ static struct cmd_handler handlers[] = { static struct cmd_handler config_handlers[] = { { "default_orientation", cmd_default_orientation }, { "swaybg_command", cmd_swaybg_command }, + { "swaynag_command", cmd_swaynag_command }, { "workspace_layout", cmd_workspace_layout }, }; @@ -511,14 +512,11 @@ struct cmd_results *cmd_results_new(enum cmd_status status, results->input = NULL; } if (format) { + char *error = malloc(256); va_list args; va_start(args, format); - size_t length = vsnprintf(NULL, 0, format, args) + 1; - char *error = malloc(length); - va_end(args); - va_start(args, format); if (error) { - vsnprintf(error, length, format, args); + vsnprintf(error, 256, format, args); } va_end(args); results->error = error; |