1
0
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:
Daniel Veillard
2003-10-08 19:19:10 +00:00
parent 97bf4d02e5
commit 828ce83d4c
5 changed files with 25 additions and 11 deletions

View File

@ -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;