diff options
author | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2008-11-20 01:40:35 (GMT) |
---|---|---|
committer | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2008-11-20 01:40:35 (GMT) |
commit | 3d7042176307f0d7700a3640f3b3bcc8790b8fcd (patch) | |
tree | ec4a9020570acc6d09366e5b305b9d162c1a6026 /samples/sample2.cc | |
parent | b6a296d0f7caff7140f422e49f5398c9ef17504d (diff) | |
download | googletest-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.cc | 4 |
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; } |