Changeset 4742 for gaycko/trunk


Ignore:
Timestamp:
Feb 2, 2011, 1:48:51 PM (9 years ago)
Author:
Jean-Yves Lamoureux
Message:
  • Realloc attributes properly
File:
1 edited

Legend:

Unmodified
Added
Removed
  • gaycko/trunk/src/dom/dom.c

    r4740 r4742  
    7777        if(node->properties) {
    7878                for(xmlAttrPtr attr = node->properties; attr != NULL; attr = attr->next) {
    79                         e->attributes = realloc(e->attributes, sizeof(gAttribute));
     79                        e->attributes = realloc(e->attributes, sizeof(gAttribute)*(e->attribute_count+1));
    8080                        e->attributes[e->attribute_count].name = strdup((const char*)attr->name);
    8181                        e->attributes[e->attribute_count].value = strdup((char*)attr->children->content);
    82             e->attribute_count++;
     82                        e->attribute_count++;
    8383                }
    8484        }
Note: See TracChangeset for help on using the changeset viewer.