diff --git a/HTMLparser.c b/HTMLparser.c index ff771a2f4c9788fd43cf9ccec179d78df6149523_SFRNTHBhcnNlci5j..b41dad88a06f34635558c6947470b35f8abba1c7_SFRNTHBhcnNlci5j 100644 --- a/HTMLparser.c +++ b/HTMLparser.c @@ -5056,8 +5056,7 @@ htmlErrMemory(NULL, "htmlInitParserCtxt: out of memory\n"); return(-1); } - else - memset(sax, 0, sizeof(htmlSAXHandler)); + memset(sax, 0, sizeof(htmlSAXHandler)); /* Allocate the Input stack */ ctxt->inputTab = (htmlParserInputPtr *) @@ -5116,11 +5115,9 @@ ctxt->nodeInfoNr = 0; ctxt->nodeInfoMax = 0; - if (sax == NULL) ctxt->sax = (xmlSAXHandlerPtr) &htmlDefaultSAXHandler; - else { - ctxt->sax = sax; - memcpy(sax, &htmlDefaultSAXHandler, sizeof(xmlSAXHandlerV1)); - } + ctxt->sax = sax; + xmlSAX2InitHtmlDefaultSAXHandler(sax); + ctxt->userData = ctxt; ctxt->myDoc = NULL; ctxt->wellFormed = 1;