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
This commit is contained in:
parent
af408d405f
commit
12811c1c3b
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user