* No space after ampersand escaped characters in XML https://github.com/clicon/clixon/issues/52

* Thanks @SCadilhac
This commit is contained in:
Olof hagsand 2018-10-29 21:41:16 +01:00
parent f273f52148
commit 7450eae046
5 changed files with 17 additions and 15 deletions

View file

@ -78,6 +78,8 @@
* Added command-line option `-t <timeout>` for clixon_netconf - quit after max time.
### Corrected Bugs
* No space after ampersand escaped characters in XML https://github.com/clicon/clixon/issues/52
* Thanks @SCadilhac
* Single quotes for XML attributes https://github.com/clicon/clixon/issues/51
* Thanks @SCadilhac
* Fixed https://github.com/clicon/clixon/issues/46 Issue with empty values in leaf-list

View file

@ -395,7 +395,7 @@ xml_chardata_encode(char **escp,
else
switch (str[i]){
case '&':
if ((l=snprintf(&esc[j], 7, "&amp; ")) < 0){
if ((l=snprintf(&esc[j], 6, "&amp;")) < 0){
clicon_err(OE_UNIX, errno, "snprintf");
goto done;
}
@ -407,14 +407,14 @@ xml_chardata_encode(char **escp,
cdata++;
break;
}
if ((l=snprintf(&esc[j], 6, "&lt; ")) < 0){
if ((l=snprintf(&esc[j], 5, "&lt;")) < 0){
clicon_err(OE_UNIX, errno, "snprintf");
goto done;
}
j += l;
break;
case '>':
if ((l=snprintf(&esc[j], 6, "&gt; ")) < 0){
if ((l=snprintf(&esc[j], 5, "&gt;")) < 0){
clicon_err(OE_UNIX, errno, "snprintf");
goto done;
}