From 12811c1c3bf188b29188ede4e4320db9ff74b691 Mon Sep 17 00:00:00 2001 From: Michael Wetherell Date: Thu, 26 Oct 2006 22:41:12 +0000 Subject: [PATCH 1/1] 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 --- src/common/fileback.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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]; -- 2.45.2