diff options
Diffstat (limited to 'sway/ipc-server.c')
-rw-r--r-- | sway/ipc-server.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c index 01b80b05..96889b39 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c | |||
@@ -481,11 +481,10 @@ void ipc_client_handle_command(struct ipc_client *client) { | |||
481 | case IPC_COMMAND: | 481 | case IPC_COMMAND: |
482 | { | 482 | { |
483 | struct cmd_results *results = execute_command(buf, NULL); | 483 | struct cmd_results *results = execute_command(buf, NULL); |
484 | const char *json = cmd_results_to_json(results); | 484 | char *json = cmd_results_to_json(results); |
485 | char reply[256]; | 485 | int length = strlen(json); |
486 | int length = snprintf(reply, sizeof(reply), "%s", json); | 486 | client_valid = ipc_send_reply(client, json, (uint32_t)length); |
487 | free(json); | 487 | free(json); |
488 | client_valid = ipc_send_reply(client, reply, (uint32_t)length); | ||
489 | free_cmd_results(results); | 488 | free_cmd_results(results); |
490 | goto exit_cleanup; | 489 | goto exit_cleanup; |
491 | } | 490 | } |