X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/254847461268bbc10cb90ca91d5feff411a16bc6..230c57431343e02d4ae3011e8a74d46fbb5575a7:/src/stc/stc.cpp diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index d3e43c21a7..efedc9d763 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -2547,8 +2547,9 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename) if (len > 0) { #if wxUSE_UNICODE - wxMemoryBuffer buffer(len); + wxMemoryBuffer buffer(len+1); success = (file.Read(buffer.GetData(), len) == len); + ((char*)buffer.GetData())[len] = 0; contents = wxString(buffer, *wxConvCurrent); #else wxString buffer;