From f379e9315fdb7f9a8d59830540453d723d571075 Mon Sep 17 00:00:00 2001 From: "Fred L. Drake, Jr." Date: Mon, 30 Dec 2002 20:02:28 +0000 Subject: [PATCH] When returning a status value through the public API, use XML_STATUS_OK / XML_STATUS_ERROR. Internal status returns are not affected. --- expat/lib/xmlparse.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c index 0ff94bde..b0251461 100644 --- a/expat/lib/xmlparse.c +++ b/expat/lib/xmlparse.c @@ -873,17 +873,20 @@ XML_ParserReset(XML_Parser parser, const XML_Char *encodingName) int XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName) { - /* block after XML_Parse()/XML_ParseBuffer() has been called */ + /* Block after XML_Parse()/XML_ParseBuffer() has been called. + XXX There's no way for the caller to determine which of the + XXX possible error cases caused the XML_STATUS_ERROR return. + */ if (parsing) - return 0; + return XML_STATUS_ERROR; if (encodingName == NULL) protocolEncodingName = NULL; else { protocolEncodingName = poolCopyString(&tempPool, encodingName); if (!protocolEncodingName) - return 0; + return XML_STATUS_ERROR; } - return 1; + return XML_STATUS_OK; } XML_Parser @@ -1116,12 +1119,12 @@ XML_SetBase(XML_Parser parser, const XML_Char *p) if (p) { p = poolCopyString(&_dtd->pool, p); if (!p) - return 0; + return XML_STATUS_ERROR; curBase = p; } else curBase = NULL; - return 1; + return XML_STATUS_OK; } const XML_Char * -- 2.40.0