diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2023-04-30 18:38:16 +0200 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2023-04-30 21:45:39 +0200 |
commit | b230861dbd2c79c322d52cabf77941d3f6ce9d14 (patch) | |
tree | 79ba7245ad6e7c27705ac8a210fc797c90551db8 | |
parent | 320f5084cd26b98af69c21d8745577183e1034e0 (diff) | |
download | libxml2-b230861dbd2c79c322d52cabf77941d3f6ce9d14.tar.gz |
xmlIO: Remove some calls to xmlIOErr
The xmlIOErr functions use the global error handler and should be
avoided if possible.
-rw-r--r-- | xmlIO.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -211,6 +211,7 @@ __xmlIOWin32UTF8ToWChar(const char *u8String) } #endif +#if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) /** * xmlIOErrMemory: * @extra: extra information @@ -222,6 +223,7 @@ xmlIOErrMemory(const char *extra) { __xmlSimpleError(XML_FROM_IO, XML_ERR_NO_MEMORY, NULL, NULL, extra); } +#endif /** * __xmlIOErr: @@ -2325,7 +2327,6 @@ xmlAllocParserInputBuffer(xmlCharEncoding enc) { ret = (xmlParserInputBufferPtr) xmlMalloc(sizeof(xmlParserInputBuffer)); if (ret == NULL) { - xmlIOErrMemory("creating input buffer"); return(NULL); } memset(ret, 0, sizeof(xmlParserInputBuffer)); @@ -2364,7 +2365,6 @@ xmlAllocOutputBuffer(xmlCharEncodingHandlerPtr encoder) { ret = (xmlOutputBufferPtr) xmlMalloc(sizeof(xmlOutputBuffer)); if (ret == NULL) { - xmlIOErrMemory("creating output buffer"); return(NULL); } memset(ret, 0, sizeof(xmlOutputBuffer)); @@ -2412,7 +2412,6 @@ xmlAllocOutputBufferInternal(xmlCharEncodingHandlerPtr encoder) { ret = (xmlOutputBufferPtr) xmlMalloc(sizeof(xmlOutputBuffer)); if (ret == NULL) { - xmlIOErrMemory("creating output buffer"); return(NULL); } memset(ret, 0, sizeof(xmlOutputBuffer)); @@ -4011,7 +4010,7 @@ xmlLoadExternalEntity(const char *URL, const char *ID, canonicFilename = (char *) xmlCanonicPath((const xmlChar *) URL); if (canonicFilename == NULL) { - xmlIOErrMemory("building canonical path\n"); + xmlErrMemory(ctxt, "building canonical path\n"); return(NULL); } |