From f7a201b94e6b6160cb1d2b08d56f88941239ca56 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 6 Dec 2002 20:59:06 +0000 Subject: [PATCH] better check of parameter in Delete() (2nd part of patch 646145) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18068 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/univ/listbox.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/univ/listbox.cpp b/src/univ/listbox.cpp index 9a519bcc22..7ae71b51fe 100644 --- a/src/univ/listbox.cpp +++ b/src/univ/listbox.cpp @@ -274,7 +274,8 @@ void wxListBox::Clear() void wxListBox::Delete(int n) { - wxCHECK_RET( n < GetCount(), _T("invalid index in wxListBox::Delete") ); + wxCHECK_RET( n >= 0 && n < GetCount(), + _T("invalid index in wxListBox::Delete") ); // do it before removing the index as otherwise the last item will not be // refreshed (as GetCount() will be decremented) -- 2.45.2