summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xml.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/xml.c b/xml.c
index 6b58bd4..c4573b4 100644
--- a/xml.c
+++ b/xml.c
@@ -416,9 +416,16 @@ xml_parse(XMLParser *x)
break;
if (datalen < sizeof(x->data) - 1)
x->data[datalen++] = c;
- if (isspace(c))
+ else {
+ /* entity too long for buffer, handle as normal data */
+ x->data[datalen] = '\0';
+ if (x->xmldata)
+ x->xmldata(x, x->data, datalen);
+ x->data[0] = c;
+ datalen = 1;
break;
- else if (c == ';') {
+ }
+ if (c == ';') {
x->data[datalen] = '\0';
if (x->xmldataentity)
x->xmldataentity(x, x->data, datalen);