if (nReadPosNext >= vch.size())
{
if (nReadPosNext > vch.size())
- {
setstate(std::ios::failbit, "CDataStream::ignore() : end of data");
- nSize = (int)(vch.size() - nReadPos);
- }
nReadPos = 0;
vch.clear();
return (*this);
unsigned int pos = (unsigned int)(nReadPos % vchBuf.size());
size_t nNow = nSize;
if (nNow + pos > vchBuf.size())
- nNow = vchBuf.size() - pos;
+ nNow = (size_t)(vchBuf.size() - pos);
if (nNow + nReadPos > nSrcPos)
- nNow = nSrcPos - nReadPos;
+ nNow = (size_t)(nSrcPos - nReadPos);
memcpy(pch, &vchBuf[pos], nNow);
nReadPos += nNow;
pch += nNow;
// search for a given byte in the stream, and remain positioned on it
void FindByte(char ch) {
- while (true) {
+ for ( ; ; ) {
if (nReadPos == nSrcPos)
Fill();
if (vchBuf[nReadPos % vchBuf.size()] == ch)