--- embedaddon/expat/lib/xmltok_impl.c 2012/02/21 23:00:54 1.1.1.1 +++ embedaddon/expat/lib/xmltok_impl.c 2014/06/15 16:09:43 1.1.1.2 @@ -885,7 +885,7 @@ PREFIX(scanPercent)(const ENCODING *enc, const char *p const char **nextTokPtr) { if (ptr == end) - return -XML_TOK_PERCENT; + return XML_TOK_PARTIAL; switch (BYTE_TYPE(enc, ptr)) { CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) case BT_S: case BT_LF: case BT_CR: case BT_PERCNT: @@ -1744,7 +1744,7 @@ PREFIX(updatePosition)(const ENCODING *enc, const char *end, POSITION *pos) { - while (ptr != end) { + while (ptr < end) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: \