diff options
author | deva <deva> | 2011-03-01 19:19:02 +0000 |
---|---|---|
committer | deva <deva> | 2011-03-01 19:19:02 +0000 |
commit | e190d38057892b69246391841b234a368bc2b4ad (patch) | |
tree | 34f946bc1c3b86997d4cd45e63c433ef07b36486 /src/saxparser.cc | |
parent | c393edc920f8ee126d1bced3500b6bc1ecf86f83 (diff) |
MAJOR rewrite of the internals. New input/output 'plugin' system. Still a lot missing.
Diffstat (limited to 'src/saxparser.cc')
-rw-r--r-- | src/saxparser.cc | 11 |
1 files changed, 9 insertions, 2 deletions
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 <stdio.h> #include <string.h> 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; } |