From 88a2ddbe83347c98dcd4bd20f6945e4923ea74ef Mon Sep 17 00:00:00 2001 From: "S. Christoffer Eliesen" Date: Fri, 23 Oct 2015 12:50:30 +0200 Subject: [PATCH] commands: Code formatting. --- sway/commands.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sway/commands.c b/sway/commands.c index 50a6e941..d742495d 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -1329,19 +1329,21 @@ struct cmd_results *cmd_results_new(enum cmd_status status, const char* input, c } void free_cmd_results(struct cmd_results *results) { - if (results->error) + if (results->error) { free(results->error); + } free(results); } const char *cmd_results_to_json(struct cmd_results *results) { json_object *root = json_object_new_object(); json_object_object_add(root, "success", json_object_new_boolean(results->status == CMD_SUCCESS)); - if (results->input) + if (results->input) { json_object_object_add(root, "input", json_object_new_string(results->input)); - if (results->error) + } + if (results->error) { json_object_object_add(root, "error", json_object_new_string(results->error)); - + } const char *json = json_object_to_json_string(root); free(root); return json;