use delete[], add assert

This commit is contained in:
Dick Hollenbeck 2010-10-20 18:11:00 -05:00
parent 8b4cad8a3e
commit 8b4bc768a9
1 changed files with 3 additions and 1 deletions

View File

@ -71,9 +71,11 @@ void LINE_READER::expandCapacity( unsigned newsize )
// resize the buffer, and copy the original data
char* bigger = new char[capacity];
wxASSERT( capacity >= length );
memcpy( bigger, line, length );
delete line;
delete[] line;
line = bigger;
}
}