X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cd2e8564d7ca31209289d32a0e503292db1a4b65..dc8a1aa53d9c71820d683aefe7ea04d7e480f63b:/contrib/src/stc/stc.cpp?ds=sidebyside

diff --git a/contrib/src/stc/stc.cpp b/contrib/src/stc/stc.cpp
index f2b2b1b8c1..f42348d4bf 100644
--- a/contrib/src/stc/stc.cpp
+++ b/contrib/src/stc/stc.cpp
@@ -3186,12 +3186,7 @@ static void SetEventText(wxStyledTextEvent& evt, const char* text,
                          size_t length) {
     if(!text) return;
 
-    // The unicode conversion MUST have a null byte to terminate the
-    // string so move it into a buffer first and give it one.
-    wxMemoryBuffer buf(length+1);
-    buf.AppendData((void*)text, length);
-    buf.AppendByte(0);
-    evt.SetText(stc2wx(buf));
+    evt.SetText(stc2wx(text, length));
 }