diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2022-09-01 03:14:13 +0200 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2022-09-01 03:35:19 +0200 |
commit | 2cac626976ac6f5883b35cf1b7b30baa5312a2ce (patch) | |
tree | 384bd45c92a659685e131b760011d97caa26f039 /HTMLparser.c | |
parent | ad338ca737c4df5a4d1c28f8ee18b878572f2964 (diff) | |
download | libxml2-2cac626976ac6f5883b35cf1b7b30baa5312a2ce.tar.gz |
Don't use sizeof(xmlChar) or sizeof(char)
Diffstat (limited to 'HTMLparser.c')
-rw-r--r-- | HTMLparser.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/HTMLparser.c b/HTMLparser.c index fd71aee8..debbe50f 100644 --- a/HTMLparser.c +++ b/HTMLparser.c @@ -2074,8 +2074,8 @@ static const htmlEntityDesc html40EntitiesTable[] = { #define growBuffer(buffer) { \ xmlChar *tmp; \ buffer##_size *= 2; \ - tmp = (xmlChar *) xmlRealloc(buffer, buffer##_size * sizeof(xmlChar)); \ - if (tmp == NULL) { \ + tmp = (xmlChar *) xmlRealloc(buffer, buffer##_size); \ + if (tmp == NULL) { \ htmlErrMemory(ctxt, "growing buffer\n"); \ xmlFree(buffer); \ return(NULL); \ @@ -2744,7 +2744,7 @@ htmlParseHTMLAttribute(htmlParserCtxtPtr ctxt, const xmlChar stop) { * allocate a translation buffer. */ buffer_size = HTML_PARSER_BUFFER_SIZE; - buffer = (xmlChar *) xmlMallocAtomic(buffer_size * sizeof(xmlChar)); + buffer = (xmlChar *) xmlMallocAtomic(buffer_size); if (buffer == NULL) { htmlErrMemory(ctxt, "buffer allocation failed\n"); return(NULL); @@ -3380,7 +3380,7 @@ htmlParsePI(htmlParserCtxtPtr ctxt) { ctxt->instate = state; return; } - buf = (xmlChar *) xmlMallocAtomic(size * sizeof(xmlChar)); + buf = (xmlChar *) xmlMallocAtomic(size); if (buf == NULL) { htmlErrMemory(ctxt, NULL); ctxt->instate = state; @@ -3398,7 +3398,7 @@ htmlParsePI(htmlParserCtxtPtr ctxt) { xmlChar *tmp; size *= 2; - tmp = (xmlChar *) xmlRealloc(buf, size * sizeof(xmlChar)); + tmp = (xmlChar *) xmlRealloc(buf, size); if (tmp == NULL) { htmlErrMemory(ctxt, NULL); xmlFree(buf); @@ -3480,7 +3480,7 @@ htmlParseComment(htmlParserCtxtPtr ctxt) { ctxt->instate = XML_PARSER_COMMENT; SHRINK; SKIP(4); - buf = (xmlChar *) xmlMallocAtomic(size * sizeof(xmlChar)); + buf = (xmlChar *) xmlMallocAtomic(size); if (buf == NULL) { htmlErrMemory(ctxt, "buffer allocation failed\n"); ctxt->instate = state; @@ -3529,7 +3529,7 @@ htmlParseComment(htmlParserCtxtPtr ctxt) { xmlChar *tmp; size *= 2; - tmp = (xmlChar *) xmlRealloc(buf, size * sizeof(xmlChar)); + tmp = (xmlChar *) xmlRealloc(buf, size); if (tmp == NULL) { xmlFree(buf); htmlErrMemory(ctxt, "growing buffer failed\n"); |