]> git.saurik.com Git - wxWidgets.git/blobdiff - src/stc/stc.cpp
added new notifications to be added, corrected DoGetBestSize
[wxWidgets.git] / src / stc / stc.cpp
index d3e43c21a74287d861ac9fe015956be1b5b6b6e0..efedc9d76350fa24c6c61a6834d91f57748998dd 100644 (file)
@@ -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;