From 2b42a87073839b2b31c105f08080626ba32b40e3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 24 Jul 2008 00:05:14 +0000 Subject: [PATCH] fix index checking in GetRange() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54777 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/textentrycmn.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/textentrycmn.cpp b/src/common/textentrycmn.cpp index 5ec6850708..4adca176b0 100644 --- a/src/common/textentrycmn.cpp +++ b/src/common/textentrycmn.cpp @@ -41,10 +41,10 @@ wxString wxTextEntryBase::GetRange(long from, long to) const { wxString sel; wxString value = GetValue(); - - if ((from < to) && ((long)value.length() >= to + from)) + + if ( from < to && (long)value.length() >= to ) { - sel = GetValue().substr(from, to - from); + sel = value.substr(from, to - from); } return sel; -- 2.45.2