Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

filebuf::underflow() bug in VS2005's stdlibrary

1 view
Skip to first unread message

Ulrich Eckhardt

unread,
Apr 26, 2006, 10:42:41 AM4/26/06
to
I'm not exactly sure which of the four snextc/sgetc/underflow/uflow is the
culprit but std::filebuf of VC8 skips every second character.

This chain of calls occurs:

snextc()
sbumpc()
uflow()
sgetc()
underflow()
uflow()

snextc() should advance to and return the next character. For that, it just
calls sbumpc() which advances to the next character and then returns that
via sgetc().

Problem is that underflow() calls uflow() but uflow() reads and advances,
i.e. since it is called twice in this graph it skips every second
character.

Note: there are some circumstances for this that could be important in order
to reproduce the bug. One is that I'm using a custom codecvt facet and the
other is that I'm using text-mode (I think these two together disable
internal buffering via gptr() etc).

Is this problem already known, is there a fix available already? I can
provide more details if necessary.

Uli

0 new messages