[Expat-discuss] Problem with XML_Parse segmentation fault.

Janeene Webb janeene at contecint.com.au
Mon Mar 29 03:04:02 EST 2004


Hi,

I'm trying to use expat for the first time, so have made and sorted out a lot 
of dumb mistakes so far.

I'm now at the point where I can send to the parser a read in file buffer, 
but:
A.  If the buffer array is larger than the read in file, I get a malformed XML 
error on the line after where the file actually ends,
   Or
B. If the buffer array is smaller than the overall file size, I get a 
segmentation fault somewhere before the end of the file. It faults at a 
different point for each buffer size specified, and will fault out on the 
second pass regardless of the size of the buffer (so if there should have 
been 4 passes still segfaults on the second).

It's probably another error due to not having used expat before, but I'm at a 
loss as to where to go from here. Any assistance greatly appreciated.

The other query I had is how to call the XML_GetCurrentLineNumber function 
from within the parser's character handler - I haven't been able to work this 
one out.

Cheers,
Janeene Webb.

Snipped code attached:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: xml.cc
Type: text/x-c++src
Size: 2020 bytes
Desc: not available
Url : http://mail.libexpat.org/pipermail/expat-discuss/attachments/20040329/a02abf93/xml.bin


More information about the Expat-discuss mailing list