From 28eedb1940dd8a80c3d5d6bf2fdc38ae8fc888dc Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Tue, 17 Jul 2012 22:10:36 +0000 Subject: [PATCH] Bug fix in SimpleString (CppUnitLite) - typo caused allocating too-small buffer --- CppUnitLite/SimpleString.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppUnitLite/SimpleString.cpp b/CppUnitLite/SimpleString.cpp index 190010d87..3fa040f63 100644 --- a/CppUnitLite/SimpleString.cpp +++ b/CppUnitLite/SimpleString.cpp @@ -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;