X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4ceb1196bb688d56bbceca98c615fa7b9222ba1d..68a9ef0ef0b8148a2cfc63b14e5b39db9071156e:/src/stc/stc.cpp diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index 4fb35f564e..bed2b4ed46 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -319,7 +319,7 @@ void wxStyledTextCtrl::SetAnchor(int posAnchor) { wxString wxStyledTextCtrl::GetCurLine(int* linePos) { wxString text; int len = LineLength(GetCurrentLine()); - char* buf = text.GetWriteBuf(len+1); + char* buf = text.GetWriteBuf(len); int pos = SendMsg(2027, len, (long)buf); text.UngetWriteBuf(); @@ -921,7 +921,7 @@ int wxStyledTextCtrl::GetFirstVisibleLine() { wxString wxStyledTextCtrl::GetLine(int line) { wxString text; int len = LineLength(line); - char* buf = text.GetWriteBuf(len+1); + char* buf = text.GetWriteBuf(len); int pos = SendMsg(2153, line, (long)buf); text.UngetWriteBuf(); @@ -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);