X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..b404a8f3b072129c107c6d9a5e0f6f53cd34807b:/src/common/stream.cpp diff --git a/src/common/stream.cpp b/src/common/stream.cpp index a3142a2843..1a03caa346 100644 --- a/src/common/stream.cpp +++ b/src/common/stream.cpp @@ -635,7 +635,7 @@ wxFileOffset wxStreamBuffer::Seek(wxFileOffset pos, wxSeekMode mode) size_t int_diff = wx_truncate_cast(size_t, diff); wxCHECK_MSG( (wxFileOffset)int_diff == diff, wxInvalidOffset, wxT("huge file not supported") ); SetIntPosition(int_diff); - return pos; + return diff; } case wxFromEnd: @@ -943,17 +943,17 @@ wxFileOffset wxInputStream::SeekI(wxFileOffset pos, wxSeekMode mode) bytes_read = Read(buf, WXSIZEOF(buf)).LastRead(); if ( m_lasterror != wxSTREAM_NO_ERROR ) return wxInvalidOffset; - + wxASSERT(bytes_read == WXSIZEOF(buf)); } - + // read the last 'pos' bytes bytes_read = Read(buf, (size_t)pos).LastRead(); if ( m_lasterror != wxSTREAM_NO_ERROR ) return wxInvalidOffset; - + wxASSERT(bytes_read == (size_t)pos); - + // we should now have seeked to the right position... return TellI(); }