From fe72e3b349f0905519481b77b22c525aca9c704d Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Thu, 5 Jul 2018 07:07:59 +0900 Subject: cmd_results_to_json: return copied string and properly free the json The only user of this function would copy the string right away to get rid of the const flag anyway, and freeing a const string afterwards might work but is not meant to be done according to the json-c API. --- include/sway/commands.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/sway/commands.h b/include/sway/commands.h index 7ca0bda8..6d17144a 100644 --- a/include/sway/commands.h +++ b/include/sway/commands.h @@ -79,7 +79,7 @@ void free_cmd_results(struct cmd_results *results); * * Free the JSON string later on. */ -const char *cmd_results_to_json(struct cmd_results *results); +char *cmd_results_to_json(struct cmd_results *results); struct cmd_results *add_color(const char *name, char *buffer, const char *color); -- cgit v1.2.3-54-g00ecf