From: Michael Wetherell Date: Thu, 26 Oct 2006 22:41:12 +0000 (+0000) Subject: For streams smaller than the buffer reduce the buffer to length + 1 instead of X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/12811c1c3bf188b29188ede4e4320db9ff74b691 For streams smaller than the buffer reduce the buffer to length + 1 instead of length, so that it doesn't go to disk. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42476 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/fileback.cpp b/src/common/fileback.cpp index e5c631f832..a0cbc707d8 100644 --- a/src/common/fileback.cpp +++ b/src/common/fileback.cpp @@ -82,8 +82,8 @@ wxBackingFileImpl::wxBackingFileImpl(wxInputStream *stream, { wxFileOffset len = m_stream->GetLength(); - if (len >= 0 && len + size_t(0) < m_bufsize) - m_bufsize = size_t(len); + if (len >= 0 && len + size_t(1) < m_bufsize) + m_bufsize = len + 1; if (m_bufsize) m_buf = new char[m_bufsize];