Commit 8b4bc768 authored by Dick Hollenbeck's avatar Dick Hollenbeck

use delete[], add assert

parent 8b4cad8a
...@@ -71,9 +71,11 @@ void LINE_READER::expandCapacity( unsigned newsize ) ...@@ -71,9 +71,11 @@ void LINE_READER::expandCapacity( unsigned newsize )
// resize the buffer, and copy the original data // resize the buffer, and copy the original data
char* bigger = new char[capacity]; char* bigger = new char[capacity];
wxASSERT( capacity >= length );
memcpy( bigger, line, length ); memcpy( bigger, line, length );
delete line; delete[] line;
line = bigger; line = bigger;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment