]> git.saurik.com Git - wxWidgets.git/blobdiff - src/stc/stc.cpp
Add utils and tests to OS/2 builds, #9587 from Dave Parsons.
[wxWidgets.git] / src / stc / stc.cpp
index 66f161d26fd42b1b581b12307d85543959d32dc7..bfa51d3001a173717f8a1a50d45808193f89bd2e 100644 (file)
@@ -3691,9 +3691,9 @@ void wxStyledTextCtrl::SetTextRaw(const char* text)
 
 wxCharBuffer wxStyledTextCtrl::GetTextRaw()
 {
-    int len  = GetTextLength();
-    wxCharBuffer buf(len);
-    SendMsg(SCI_GETTEXT, len, (long)buf.data());
+    int len = GetTextLength();
+    wxCharBuffer buf(len); // adds 1 for NUL automatically
+    SendMsg(SCI_GETTEXT, len + 1, (long)buf.data());
     return buf;
 }