diff options
Diffstat (limited to 'src/Editor.cxx')
| -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 42b71e3c8..cb6a8a183 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -5796,7 +5796,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; | 
