[Expat-bugs] [XML_GetInputContext] bad behavior

Pierre Guilbert guilbep at gmail.com
Thu Oct 8 14:21:36 CEST 2009


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.libexpat.org/pipermail/expat-bugs/attachments/20091008/05d84491/attachment.htm>


More information about the Expat-bugs mailing list