diff --git a/contrib/src/stc/gen_iface.py b/contrib/src/stc/gen_iface.py index 6798593426..293eff48c8 100644 --- a/contrib/src/stc/gen_iface.py +++ b/contrib/src/stc/gen_iface.py @@ -338,7 +338,7 @@ methodOverrideMap = { '''wxString %s() { wxString text; - int len = GetTextLength(); + int len = GetTextLength()+1; char* buff = text.GetWriteBuf(len+1); SendMsg(%s, len, (long)buff); diff --git a/contrib/src/stc/stc.cpp b/contrib/src/stc/stc.cpp index 4fb35f564e..35655c3411 100644 --- a/contrib/src/stc/stc.cpp +++ b/contrib/src/stc/stc.cpp @@ -1077,7 +1077,7 @@ void wxStyledTextCtrl::SetText(const wxString& text) { // Retrieve all the text in the document. wxString wxStyledTextCtrl::GetText() { wxString text; - int len = GetTextLength(); + int len = GetTextLength()+1; char* buff = text.GetWriteBuf(len+1); SendMsg(2182, len, (long)buff); diff --git a/src/stc/gen_iface.py b/src/stc/gen_iface.py index 6798593426..293eff48c8 100644 --- a/src/stc/gen_iface.py +++ b/src/stc/gen_iface.py @@ -338,7 +338,7 @@ methodOverrideMap = { '''wxString %s() { wxString text; - int len = GetTextLength(); + int len = GetTextLength()+1; char* buff = text.GetWriteBuf(len+1); SendMsg(%s, len, (long)buff); diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index 4fb35f564e..35655c3411 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -1077,7 +1077,7 @@ void wxStyledTextCtrl::SetText(const wxString& text) { // Retrieve all the text in the document. wxString wxStyledTextCtrl::GetText() { wxString text; - int len = GetTextLength(); + int len = GetTextLength()+1; char* buff = text.GetWriteBuf(len+1); SendMsg(2182, len, (long)buff);