aboutsummaryrefslogtreecommitdiffstats
path: root/xmlIO.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2003-10-08 19:19:10 +0000
committerDaniel Veillard <veillard@src.gnome.org>2003-10-08 19:19:10 +0000
commit828ce83d4c4110bf6eb0f19463900de24da7dac9 (patch)
treece38cb7b16392d689297f896a5498ae125b8eadc /xmlIO.c
parent97bf4d02e5bdd07720e104eead52baa5ddff71fd (diff)
downloadandroid_external_libxml2-828ce83d4c4110bf6eb0f19463900de24da7dac9.tar.gz
android_external_libxml2-828ce83d4c4110bf6eb0f19463900de24da7dac9.tar.bz2
android_external_libxml2-828ce83d4c4110bf6eb0f19463900de24da7dac9.zip
more cleanup through the I/O error path Daniel
* error.c tree.c xmlIO.c xmllint.c: more cleanup through the I/O error path Daniel
Diffstat (limited to 'xmlIO.c')
-rw-r--r--xmlIO.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/xmlIO.c b/xmlIO.c
index 2a353847..ae4aa08a 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -1974,32 +1974,35 @@ xmlFreeParserInputBuffer(xmlParserInputBufferPtr in) {
* Returns the number of byte written or -1 in case of error.
*/
int
-xmlOutputBufferClose(xmlOutputBufferPtr out) {
+xmlOutputBufferClose(xmlOutputBufferPtr out)
+{
int written;
int err_rc = 0;
if (out == NULL)
- return(-1);
+ return (-1);
if (out->writecallback != NULL)
- xmlOutputBufferFlush(out);
+ xmlOutputBufferFlush(out);
if (out->closecallback != NULL) {
- err_rc = out->closecallback(out->context);
+ err_rc = out->closecallback(out->context);
}
written = out->written;
if (out->conv) {
xmlBufferFree(out->conv);
- out->conv = NULL;
+ out->conv = NULL;
}
if (out->encoder != NULL) {
xmlCharEncCloseFunc(out->encoder);
}
if (out->buffer != NULL) {
xmlBufferFree(out->buffer);
- out->buffer = NULL;
+ out->buffer = NULL;
}
+ if (out->error)
+ err_rc = -1;
xmlFree(out);
- return( ( err_rc == 0 ) ? written : err_rc );
+ return ((err_rc == 0) ? written : err_rc);
}
#endif /* LIBXML_OUTPUT_ENABLED */