]> git.saurik.com Git - wxWidgets.git/commitdiff
For streams smaller than the buffer reduce the buffer to length + 1 instead of
authorMichael Wetherell <mike.wetherell@ntlworld.com>
Thu, 26 Oct 2006 22:41:12 +0000 (22:41 +0000)
committerMichael Wetherell <mike.wetherell@ntlworld.com>
Thu, 26 Oct 2006 22:41:12 +0000 (22:41 +0000)
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

index e5c631f832800c7a10e7e17b9a30c8d306338fb0..a0cbc707d8b367a6521235c339c4cce5bddec717 100644 (file)
@@ -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];