summaryrefslogtreecommitdiff
path: root/xmlIO.c
diff options
context:
space:
mode:
Diffstat (limited to 'xmlIO.c')
-rw-r--r--xmlIO.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xmlIO.c b/xmlIO.c
index 1ca80c9..83fb242 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -3084,7 +3084,7 @@ xmlOutputBufferWriteEscape(xmlOutputBufferPtr out, const xmlChar *str,
}
ret = escaping(out->buffer->content + out->buffer->use ,
&chunk, str, &cons);
- if (ret < 0)
+ if ((ret < 0) || (chunk == 0)) /* chunk==0 => nothing done */
return(-1);
out->buffer->use += chunk;
out->buffer->content[out->buffer->use] = 0;
@@ -3105,7 +3105,7 @@ xmlOutputBufferWriteEscape(xmlOutputBufferPtr out, const xmlChar *str,
} else {
ret = escaping(out->buffer->content + out->buffer->use ,
&chunk, str, &cons);
- if (ret < 0)
+ if ((ret < 0) || (chunk == 0)) /* chunk==0 => nothing done */
return(-1);
out->buffer->use += chunk;
out->buffer->content[out->buffer->use] = 0;