diff options
author | Zufu Liu <unknown> | 2019-05-04 07:33:36 +1000 |
---|---|---|
committer | Zufu Liu <unknown> | 2019-05-04 07:33:36 +1000 |
commit | 19119c5118b845f3bfd0b0c63441336019ecc351 (patch) | |
tree | 117050651ad9bb6b9427ea79236f9cb9098abee2 /src | |
parent | 9e002fa3716e99b6170a9c6339194c7a6dcb4f87 (diff) | |
download | scintilla-mirror-19119c5118b845f3bfd0b0c63441336019ecc351.tar.gz |
Backport: Bug [#2102]. Allow length argument to be past end of document for SCI_GETTEXT.
More compatible with state before change set 7489.
Backport of changeset 7490:2550e2a306c0.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index cd214de56..3d76952c1 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -5792,7 +5792,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { if (wParam == 0) return 0; char *ptr = CharPtrFromSPtr(lParam); - const Sci_Position len = wParam - 1; + const Sci_Position len = std::min<Sci_Position>(wParam - 1, pdoc->Length()); pdoc->GetCharRange(ptr, 0, len); ptr[len] = '\0'; return len; |