X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/719ee9c389634c6e51908b8a298884df520c196b..1ab36908f93242d578b42d314e93dec6a2e2819a:/src/stc/PlatWX.cpp diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index 43b6a2a443..d1e45d45fb 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -1251,6 +1251,10 @@ double ElapsedTime::Duration(bool reset) { #if wxUSE_UNICODE wxString stc2wx(const char* str, size_t len) { + if (str[len] == 0) + // It's already terminated correctly. + return wxString(str, wxConvUTF8, len); + char *buffer=new char[len+1]; strncpy(buffer, str, len); buffer[len]=0;