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:
8
xmlIO.c
8
xmlIO.c
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user