diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2019-10-14 17:04:04 +0200 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2019-10-14 17:06:36 +0200 |
commit | d8999b1da03006390f22a4dc8fafcbbab92f3594 (patch) | |
tree | b07c37a05a1309ec06302bcb0de963befd500049 /xmlwriter.c | |
parent | 40e00bc5174ab61036c893078123467144b05a4a (diff) | |
download | libxml2-d8999b1da03006390f22a4dc8fafcbbab92f3594.tar.gz |
Fix error code in xmlTextWriterStartDocument
Return XML_ERR_UNSUPPORTED_ENCODING if no encoding handler could be
found.
Fixes bug #521808:
https://bugzilla.gnome.org/show_bug.cgi?id=521808
Resolves !53.
Diffstat (limited to 'xmlwriter.c')
-rw-r--r-- | xmlwriter.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xmlwriter.c b/xmlwriter.c index 58ffab63..58445c84 100644 --- a/xmlwriter.c +++ b/xmlwriter.c @@ -541,8 +541,8 @@ xmlTextWriterStartDocument(xmlTextWriterPtr writer, const char *version, if (encoding != NULL) { encoder = xmlFindCharEncodingHandler(encoding); if (encoder == NULL) { - xmlWriterErrMsg(writer, XML_ERR_NO_MEMORY, - "xmlTextWriterStartDocument : out of memory!\n"); + xmlWriterErrMsg(writer, XML_ERR_UNSUPPORTED_ENCODING, + "xmlTextWriterStartDocument : unsupported encoding\n"); return -1; } } |