if (errorCode == XML_ERROR_NONE)
return 1;
eventEndPtr = eventPtr;
+ processor = errorProcessor;
return 0;
}
else if (bufferPtr == bufferEnd) {
if (errorCode == XML_ERROR_NONE)
return 1;
eventEndPtr = eventPtr;
+ processor = errorProcessor;
return 0;
}
errorCode = processor(parser, s, parseEndPtr = s + len, &end);
if (errorCode != XML_ERROR_NONE) {
eventEndPtr = eventPtr;
+ processor = errorProcessor;
return 0;
}
XmlUpdatePosition(encoding, positionPtr, end, &position);
if (buffer == 0 || nLeftOver > bufferLim - buffer) {
/* FIXME avoid integer overflow */
buffer = buffer == 0 ? malloc(len * 2) : realloc(buffer, len * 2);
+ /* FIXME storage leak if realloc fails */
if (!buffer) {
errorCode = XML_ERROR_NO_MEMORY;
eventPtr = eventEndPtr = 0;
+ processor = errorProcessor;
return 0;
}
bufferLim = buffer + len * 2;
}
else {
eventEndPtr = eventPtr;
+ processor = errorProcessor;
return 0;
}
}
otherwise just check the attributes for well-formedness. */
static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *enc,
- const char *s, TAG_NAME *tagNamePtr,
+ const char *attStr, TAG_NAME *tagNamePtr,
BINDING **bindingsPtr)
{
ELEMENT_TYPE *elementType = 0;
}
nDefaultAtts = elementType->nDefaultAtts;
}
- n = XmlGetAttributes(enc, s, attsSize, atts);
+ n = XmlGetAttributes(enc, attStr, attsSize, atts);
if (n + nDefaultAtts > attsSize) {
int oldAttsSize = attsSize;
attsSize = n + nDefaultAtts + INIT_ATTS_SIZE;
if (!atts)
return XML_ERROR_NO_MEMORY;
if (n > oldAttsSize)
- XmlGetAttributes(enc, s, n, atts);
+ XmlGetAttributes(enc, attStr, n, atts);
}
appAtts = (const XML_Char **)atts;
for (i = 0; i < n; i++) {
const char *entityTextPtr,
const char *entityTextEnd)
{
- const ENCODING *internalEnc = ns ? XmlGetInternalEncodingNS() : XmlGetInternalEncoding();
STRING_POOL *pool = &(dtd.pool);
entityTextPtr += encoding->minBytesPerChar;
entityTextEnd -= encoding->minBytesPerChar;