{
ELEMENT_TYPE *elementType = 0;
int nDefaultAtts = 0;
- const char **appAtts = (const char **)atts;
+ const char **appAtts;
int i;
int n;
n = XmlGetAttributes(enc, s, attsSize, atts);
if (n + nDefaultAtts > attsSize) {
- attsSize = 2*n;
+ int oldAttsSize = attsSize;
+ attsSize = n + nDefaultAtts + INIT_ATTS_SIZE;
atts = realloc((void *)atts, attsSize * sizeof(ATTRIBUTE));
if (!atts)
return XML_ERROR_NO_MEMORY;
- if (n > attsSize)
+ if (n > oldAttsSize)
XmlGetAttributes(enc, s, n, atts);
}
+ appAtts = (const char **)atts;
for (i = 0; i < n; i++) {
ATTRIBUTE_ID *attId = getAttributeId(parser, enc, atts[i].name,
atts[i].name