X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3bc69d48db7cd54db9c67dedfe82cc13890bcf71..23dd0dcea96a6ac281cda9e861c6675b4ae53d15:/src/common/ffile.cpp diff --git a/src/common/ffile.cpp b/src/common/ffile.cpp index ae19669204..932498efcd 100644 --- a/src/common/ffile.cpp +++ b/src/common/ffile.cpp @@ -102,12 +102,12 @@ bool wxFFile::ReadAll(wxString *str, const wxMBConv& conv) clearerr(m_fp); - wxCharBuffer buf(length + 1); + wxCharBuffer buf(length); // note that real length may be less than file length for text files with DOS EOLs // ('\r's get dropped by CRT when reading which means that we have // realLen = fileLen - numOfLinesInTheFile) - length = fread(buf.data(), sizeof(char), length, m_fp); + length = fread(buf.data(), 1, length, m_fp); if ( Error() ) {