From e6ad10a5b9709d26b0988c258783835d063a3b08 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Mon, 1 Nov 2010 11:35:14 +0100 Subject: [PATCH] Cleanup encoding pointer comparison * parser.c: Compare encoding pointer with a NULL instead of xmlCharEncoding enum value 0 then casted to char * ! --- parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parser.c b/parser.c index 1db706bb..e8cd1237 100644 --- a/parser.c +++ b/parser.c @@ -6609,7 +6609,7 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const xmlChar *ExternalID, xmlDetectSAX2(ctxt); GROW; - if ((ctxt->encoding == (const xmlChar *)XML_CHAR_ENCODING_NONE) && + if ((ctxt->encoding == NULL) && (ctxt->input->end - ctxt->input->cur >= 4)) { xmlChar start[4]; xmlCharEncoding enc; @@ -10105,7 +10105,7 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) { if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) ctxt->sax->setDocumentLocator(ctxt->userData, &xmlDefaultSAXLocator); - if ((ctxt->encoding == (const xmlChar *)XML_CHAR_ENCODING_NONE) && + if ((ctxt->encoding == NULL) && ((ctxt->input->end - ctxt->input->cur) >= 4)) { /* * Get the 4 first bytes and decode the charset