Re: unclosed token

Sebastian Pipping <[email protected]>
Newsgroups gmane.text.xml.expat.general
Message-ID <[email protected]>
>From a quick look over the code this line seems very odd to me:

   int len = sizeof(buf);      /* xml.c, line 30 */

[buf] is of type [char *] and therefore [len] probably
is 4 on your system. What you want in there is the length
of the string instead. Maybe that is the bug already.

Another thing I noticed is you don't call
XML_ParserFree if XML_Parse fails although you have to.

Also "[t]he string your handler receives is NOT zero
terminated" [1]. That means your character handler will
cause trouble sooner or later:

   printf("DATA=%s \n", s);     /* xml.c, line 16 */

That's all I can do for you right now.



Sebastian


[1] http://www.xml.com/pub/a/1999/09/expat/index.html?page=3#chardatahandler
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.