From 9441da1902f0b03b8b1601e205d68a1454f6f2da Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 20 Sep 2002 21:39:59 +0000 Subject: [PATCH] Fix in ::Grow for when the 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@17306 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/dynarray.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/dynarray.cpp b/src/common/dynarray.cpp index 1b3a0353b9..e8f7519f50 100644 --- a/src/common/dynarray.cpp +++ b/src/common/dynarray.cpp @@ -110,7 +110,7 @@ name& name::operator=(const name& src) \ void name::Grow(size_t nIncrement) \ { \ /* only do it if no more place */ \ - if( m_nCount == m_nSize ) { \ + if( (m_nCount == m_nSize) || ((m_nSize - m_nCount) < nIncrement) ) { \ if( m_nSize == 0 ) { \ /* was empty, determine initial size */ \ size_t size = WX_ARRAY_DEFAULT_INITIAL_SIZE; \