From 07cbd27aaa89982444b374ea6a0fe97d5a24425f Mon Sep 17 00:00:00 2001 From: Stefan Neis Date: Sat, 21 Sep 2002 00:01:26 +0000 Subject: [PATCH] Fix in wxArrayString::Grow to also handle situation where array is not yet full but the nIncrement is greater than the space left. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17311 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/string.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/string.cpp b/src/common/string.cpp index 32a0adab79..395a09476c 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -1752,7 +1752,7 @@ void wxArrayString::Copy(const wxArrayString& src) void wxArrayString::Grow(size_t nIncrement) { // only do it if no more place - if ( m_nCount == m_nSize ) { + if ( (m_nSize - m_nCount) < nIncrement ) { // if ARRAY_DEFAULT_INITIAL_SIZE were set to 0, the initially empty would // be never resized! #if ARRAY_DEFAULT_INITIAL_SIZE == 0