[XML_GetInputContext] bad behavior
Pierre Guilbert <[email protected]> Thu, 8 Oct 2009 14:21:36 +0200
| Newsgroups | gmane.text.xml.expat.bugs |
|---|---|
| Message-ID | <[email protected]> |
Good news everyone! I have an issue with a call to XML_GetInputContext Expat VersionNumber: 2.01 Example:_____________________________________________ (1). XML_GetInputContext(parser, &curr_offset, &curr_size) Curr_offset is thepointer to int giving as a parameter to (1) same for curr_size which represent buffer input size inputsize is the real input size giving to XML_Parse ===================================================== curr_offset: 3358; curr_size: 5120; inputsize: 4096 curr_offset: 1229; curr_size: 5120; inputsize: 4096 curr_offset: 3817; curr_size: 5120; inputsize: 4096 curr_offset: 2933; curr_size: 5120; inputsize: 4096 curr_offset: 2894; curr_size: 5120; inputsize: 4096 curr_offset: 4169; curr_size: 5120; inputsize: 4096====================================================== The issue is situated when calling XML_GetInputContext(XML_Parser p, int *offset, int *inputSize); It's not a very *big* problem, but to avoid it I have to put the real size of the input buffer in the (void* userData) structure. If I want to get the real offset I do (offset - (inputSize - realSize)) I don't think it's a correct behavior. It's not plateform specific hence I tested it on windows xp with VisualStudio2005 and debian with stable packages, and the result are the same. Any Idea? Regards, Pierre Guilbert PS: please forgive me for any grammar/vocabulary mistakes, I'm not a native english speaker. _______________________________________________ Expat-bugs mailing list [email protected] http://mail.libexpat.org/mailman/listinfo/expat-bugs