1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-24 13:33:01 +03:00

writer: Implement xmlTextWriterClose

This function can be used to make sure that closing the output stream
succeeded.

Fixes #513.
This commit is contained in:
Nick Wellnhofer
2024-01-05 20:31:10 +01:00
parent f237e5b934
commit d2b55a7a02
4 changed files with 80 additions and 5 deletions

View File

@@ -1508,7 +1508,8 @@ xmlFreeParserInputBuffer(xmlParserInputBufferPtr in) {
* flushes and close the output I/O channel
* and free up all the associated resources
*
* Returns the number of byte written or -1 in case of error.
* Returns the number of byte written or a negative xmlParserErrors
* code in case of error.
*/
int
xmlOutputBufferClose(xmlOutputBufferPtr out)
@@ -1532,11 +1533,8 @@ xmlOutputBufferClose(xmlOutputBufferPtr out)
}
}
/*
* TODO: Report the error code
*/
if (out->error != XML_ERR_OK)
ret = -1;
ret = -out->error;
else
ret = out->written;