From afc2b641d3e5578186e5d75ffa77dcc585c59388 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 28 Jul 2001 02:57:53 +0000 Subject: [PATCH] A couple off-by-one fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11197 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/src/stc/gen_iface.py | 4 ++-- contrib/src/stc/stc.cpp | 4 ++-- src/stc/gen_iface.py | 4 ++-- src/stc/stc.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/contrib/src/stc/gen_iface.py b/contrib/src/stc/gen_iface.py index 293eff48c8..be86c9ce0e 100644 --- a/contrib/src/stc/gen_iface.py +++ b/contrib/src/stc/gen_iface.py @@ -112,7 +112,7 @@ methodOverrideMap = { '''wxString %s(int* linePos) { wxString text; int len = LineLength(GetCurrentLine()); - char* buf = text.GetWriteBuf(len+1); + char* buf = text.GetWriteBuf(len); int pos = SendMsg(%s, len, (long)buf); text.UngetWriteBuf(); @@ -280,7 +280,7 @@ methodOverrideMap = { '''wxString %s(int line) { wxString text; int len = LineLength(line); - char* buf = text.GetWriteBuf(len+1); + char* buf = text.GetWriteBuf(len); int pos = SendMsg(%s, line, (long)buf); text.UngetWriteBuf(); diff --git a/contrib/src/stc/stc.cpp b/contrib/src/stc/stc.cpp index 35655c3411..bed2b4ed46 100644 --- a/contrib/src/stc/stc.cpp +++ b/contrib/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(); diff --git a/src/stc/gen_iface.py b/src/stc/gen_iface.py index 293eff48c8..be86c9ce0e 100644 --- a/src/stc/gen_iface.py +++ b/src/stc/gen_iface.py @@ -112,7 +112,7 @@ methodOverrideMap = { '''wxString %s(int* linePos) { wxString text; int len = LineLength(GetCurrentLine()); - char* buf = text.GetWriteBuf(len+1); + char* buf = text.GetWriteBuf(len); int pos = SendMsg(%s, len, (long)buf); text.UngetWriteBuf(); @@ -280,7 +280,7 @@ methodOverrideMap = { '''wxString %s(int line) { wxString text; int len = LineLength(line); - char* buf = text.GetWriteBuf(len+1); + char* buf = text.GetWriteBuf(len); int pos = SendMsg(%s, line, (long)buf); text.UngetWriteBuf(); diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index 35655c3411..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(); -- 2.45.2