From e190d38057892b69246391841b234a368bc2b4ad Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 1 Mar 2011 19:19:02 +0000 Subject: MAJOR rewrite of the internals. New input/output 'plugin' system. Still a lot missing. --- src/saxparser.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/saxparser.cc') diff --git a/src/saxparser.cc b/src/saxparser.cc index 19c6142..1090ef3 100644 --- a/src/saxparser.cc +++ b/src/saxparser.cc @@ -25,6 +25,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include "saxparser.h" + +#include #include static void character_hndl(void *p, const XML_Char *s, int len) @@ -90,8 +92,13 @@ int SAXParser::parse() do { len = readData(buf, sizeof(buf) - 1); - if (! XML_Parse(p, buf, len, len == 0)) { - parseError(buf, len, XML_ErrorString(XML_GetErrorCode(p)), (int)XML_GetCurrentLineNumber(p)); + if(len == -1) { + parseError((char*)"", 0, "Could not read data", 0); + return 1; + } + if(!XML_Parse(p, buf, len, len == 0)) { + parseError(buf, len, XML_ErrorString(XML_GetErrorCode(p)), + (int)XML_GetCurrentLineNumber(p)); return 1; } -- cgit v1.2.3