translate xml->json \n correctly

This commit is contained in:
Olof Hagsand 2018-02-17 20:51:42 +00:00
parent 2acacbf087
commit 1e88c38877
2 changed files with 7 additions and 0 deletions

View file

@ -1,6 +1,10 @@
# Clixon Changelog # Clixon Changelog
## 3.6.0 (Upcoming) ## 3.6.0 (Upcoming)
### Major changes:
### Minor changes:
### Corrected Bugs
* Translate xml->json \n correctly
## 3.5.0 (12 February 2018) ## 3.5.0 (12 February 2018)

View file

@ -216,6 +216,9 @@ json_str_escape(char *str)
for (i=0;i<strlen(str);i++) for (i=0;i<strlen(str);i++)
switch (str[i]){ switch (str[i]){
case '\n': case '\n':
snew[j++]='\\';
snew[j++]='n';
break;
case '\"': case '\"':
case '\\': case '\\':
snew[j++]='\\'; snew[j++]='\\';