[Expat-discuss] need to free after calling XML_GetBuffer?
lee_guoquan at hotmail.com
Sun Mar 13 03:49:04 CET 2005
I am having some error using expat in c++. I get XML_STATUS_ERROR after
calling XML_GetBuffer. I am calling XML_GetBuffer within a while loop like
void *buff = XML_GetBuffer(p,10240); // p is a xml parser
if(buff == NULL) return;
bytes_read = read(fd, buff, 10240); //fd is a file descriptor pointing to
a xml document of interest
if(bytes_read < 0) return;
status = XML_ParseBuffer(p, buff, bytes_read, bytes_read==0); //status is
of type XML_Status
I looked into the contents of buff when the program reported
XML_STATUS_ERROR and realized that some of the contents in buff were from
the previous iteration of XML_GetBuffer. Why is that? What is the cause of
XML_STATUS_ERROR and how to rectify it?
Get an advanced look at the new version of MSN Messenger.
More information about the Expat-discuss