summaryrefslogtreecommitdiffstats
path: root/samples/sample2.cc
diff options
context:
space:
mode:
authorvladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2008-11-20 01:40:35 (GMT)
committervladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2008-11-20 01:40:35 (GMT)
commit3d7042176307f0d7700a3640f3b3bcc8790b8fcd (patch)
treeec4a9020570acc6d09366e5b305b9d162c1a6026 /samples/sample2.cc
parentb6a296d0f7caff7140f422e49f5398c9ef17504d (diff)
downloadgoogletest-3d7042176307f0d7700a3640f3b3bcc8790b8fcd.zip
googletest-3d7042176307f0d7700a3640f3b3bcc8790b8fcd.tar.gz
googletest-3d7042176307f0d7700a3640f3b3bcc8790b8fcd.tar.bz2
Value-parameterized tests and many bugfixes
Diffstat (limited to 'samples/sample2.cc')
-rw-r--r--samples/sample2.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/samples/sample2.cc b/samples/sample2.cc
index 42937d1..53857c0 100644
--- a/samples/sample2.cc
+++ b/samples/sample2.cc
@@ -33,13 +33,15 @@
#include "sample2.h"
+#include <string.h>
+
// Clones a 0-terminated C string, allocating memory using new.
const char * MyString::CloneCString(const char * c_string) {
if (c_string == NULL) return NULL;
const size_t len = strlen(c_string);
char * const clone = new char[ len + 1 ];
- strcpy(clone, c_string);
+ memcpy(clone, c_string, len + 1);
return clone;
}