Fix in <array>::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
This commit is contained in:
Robin Dunn
2002-09-20 21:39:59 +00:00
parent fa0e662ad9
commit 9441da1902

View File

@@ -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; \