mirror of
https://github.com/swaywm/sway.git
synced 2025-11-09 13:29:49 -05:00
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.
This commit is contained in:
parent
9314c45c41
commit
fe72e3b349
3 changed files with 8 additions and 9 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue