Bug fix in SimpleString (CppUnitLite) - typo caused allocating too-small buffer

release/4.3a0
Richard Roberts 2012-07-17 22:10:36 +00:00
parent b5e10eadb8
commit 28eedb1940
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ SimpleString SimpleString::operator+ (const SimpleString& other)
{
SimpleString ret;
delete [] ret.buffer_;
ret.buffer_ = new char [size() + other.size() - 1];
ret.buffer_ = new char [size() + other.size() + 1];
strcpy(ret.buffer_, buffer_);
strcat(ret.buffer_, other.buffer_);
return ret;