mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-26 00:37:43 +03:00
Cleanup encoding pointer comparison
* parser.c: Compare encoding pointer with a NULL instead of xmlCharEncoding enum value 0 then casted to char * !
This commit is contained in:
committed by
Daniel Veillard
parent
8ad2930f62
commit
e6ad10a5b9
4
parser.c
4
parser.c
@@ -6609,7 +6609,7 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const xmlChar *ExternalID,
|
|||||||
xmlDetectSAX2(ctxt);
|
xmlDetectSAX2(ctxt);
|
||||||
GROW;
|
GROW;
|
||||||
|
|
||||||
if ((ctxt->encoding == (const xmlChar *)XML_CHAR_ENCODING_NONE) &&
|
if ((ctxt->encoding == NULL) &&
|
||||||
(ctxt->input->end - ctxt->input->cur >= 4)) {
|
(ctxt->input->end - ctxt->input->cur >= 4)) {
|
||||||
xmlChar start[4];
|
xmlChar start[4];
|
||||||
xmlCharEncoding enc;
|
xmlCharEncoding enc;
|
||||||
@@ -10105,7 +10105,7 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
|
|||||||
if ((ctxt->sax) && (ctxt->sax->setDocumentLocator))
|
if ((ctxt->sax) && (ctxt->sax->setDocumentLocator))
|
||||||
ctxt->sax->setDocumentLocator(ctxt->userData, &xmlDefaultSAXLocator);
|
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)) {
|
((ctxt->input->end - ctxt->input->cur) >= 4)) {
|
||||||
/*
|
/*
|
||||||
* Get the 4 first bytes and decode the charset
|
* Get the 4 first bytes and decode the charset
|
||||||
|
|||||||
Reference in New Issue
Block a user