mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-28 00:21:53 +03:00
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
This commit is contained in:
9
error.c
9
error.c
@ -350,9 +350,14 @@ xmlReportError(xmlErrorPtr err, xmlParserCtxtPtr ctxt, const char *str,
|
||||
if (code == XML_ERR_OK)
|
||||
return;
|
||||
if (str != NULL) {
|
||||
channel(data, "%s", str);
|
||||
int len;
|
||||
len = xmlStrlen((const xmlChar *)str);
|
||||
if ((len > 0) && (str[len - 1] != '\n'))
|
||||
channel(data, "%s", str);
|
||||
else
|
||||
channel(data, "%s\n", str);
|
||||
} else {
|
||||
channel(data, "%s", "out of memory error");
|
||||
channel(data, "%s\n", "out of memory error");
|
||||
}
|
||||
if (code == XML_ERR_OK)
|
||||
return;
|
||||
|
Reference in New Issue
Block a user