mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-30 22:43:14 +03:00
Don't use sizeof(xmlChar) or sizeof(char)
This commit is contained in:
14
HTMLparser.c
14
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");
|
||||
|
Reference in New Issue
Block a user