Possible Issue With Buffered Input Stream

In int BufferedInputStream::read (void* destBuffer, int maxBytesToRead)
{
there are the following few lines:

auto oldLastReadPos = lastReadPos;

        if (! ensureBuffered()
             || oldLastReadPos == lastReadPos
             || isExhausted())
            break;

oldLastReadPos will always equal lastReadPos so this will always execute the break.

No, lastReadPos is a class member variable, and the call to ensureBuffered() modifies it.

That makes sense. Did not realize ensureBuffered updated that variable, duh… Thanks