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
This commit is contained in:
Stefan Neis
2002-09-21 00:01:26 +00:00
parent 6d9a4c4d6f
commit 07cbd27aaa

View File

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