diff options
author | portix <none@none> | 2013-02-01 01:14:41 +0100 |
---|---|---|
committer | portix <none@none> | 2013-02-01 01:14:41 +0100 |
commit | 3182ab0b97f621f4e4fd5a4f56e8d7400a995ccd (patch) | |
tree | c8891b1de5f588331056a321d18fa95d67f1aa7c /src/util.c | |
parent | 876f8dbffea7286078d3548af49031a8c4e20d8a (diff) | |
download | dwb-3182ab0b97f621f4e4fd5a4f56e8d7400a995ccd.zip |
Escape all characters that must be escaped in util_create_json, additional argument-parameter in commands_simple_command
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -773,7 +773,14 @@ util_create_json(int n, ...) { else { g_string_append_c(string, '"'); while (*cval) { - if (*cval == '"') + if ( *cval == '"' + || *cval == '/' + || *cval == '\\' + || *cval == '\b' + || *cval == '\f' + || *cval == '\n' + || *cval == '\r' + || *cval == '\t') g_string_append_c(string, '\\'); g_string_append_c(string, *cval); cval++; |