Fix off-by-1 read err in switch_xml

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12628 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Mathieu Rene
2009-03-16 20:28:22 +00:00
parent 16009c5094
commit 53ab0e2aef
6 changed files with 9 additions and 11 deletions

View File

@@ -2035,7 +2035,7 @@ static char *switch_xml_toxml_r(switch_xml_t xml, char **s, switch_size_t *len,
*s = tmp;
}
if (*(*s + (*len) - 1) == '>') {
if (*len && *(*s + (*len) - 1) == '>') {
*len += sprintf(*s + *len, "\n"); /* indent */
}
for (lcount = 0; lcount < *count; lcount++) {