Skip to content

Commit

Permalink
Return nul terminated strings from iks_string() for cdata nodes
Browse files Browse the repository at this point in the history
git-svn-id: https://iksemel.googlecode.com/svn/trunk@35 6ddeccfd-2234-0410-8ab0-45b763562eda
  • Loading branch information
meduketto@gmail.com committed Oct 10, 2011
1 parent 770669e commit edc22b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
@@ -1,3 +1,6 @@
2001-10-10 Gurer
* iks.c: iks_string() returns nul terminated strings for cdata nodes

2001-10-07 Gurer
* sax.c: Fix handling of ending ]] sequences in CDATA sections
bug report and patch by oscarvdbosch
Expand Down
4 changes: 2 additions & 2 deletions src/iks.c
Expand Up @@ -591,8 +591,8 @@ iks_string (ikstack *s, iks *x)
if (s) {
return iks_stack_strdup (s, IKS_CDATA_CDATA (x), IKS_CDATA_LEN (x));
} else {
ret = iks_malloc (IKS_CDATA_LEN (x));
memcpy (ret, IKS_CDATA_CDATA (x), IKS_CDATA_LEN (x));
ret = iks_malloc (IKS_CDATA_LEN (x) + 1);
memcpy (ret, IKS_CDATA_CDATA (x), IKS_CDATA_LEN (x) + 1);
return ret;
}
}
Expand Down

0 comments on commit edc22b8

Please sign in to comment.