summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/testSystemTools.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-09-30 14:07:56 (GMT)
committerBrad King <brad.king@kitware.com>2017-09-30 14:07:56 (GMT)
commit90f1b9ad4ebc882bb3f45834c8a5953ba1cee3c2 (patch)
tree69807a1a5b5e4df1aa7f30bfeeea1a2f0b31a14f /Source/kwsys/testSystemTools.cxx
parent5dd75e35959a25d22d8535263cb414763699b584 (diff)
parent4532b0357261af903f86bc29429ae3c9413b54ab (diff)
downloadCMake-90f1b9ad4ebc882bb3f45834c8a5953ba1cee3c2.zip
CMake-90f1b9ad4ebc882bb3f45834c8a5953ba1cee3c2.tar.gz
CMake-90f1b9ad4ebc882bb3f45834c8a5953ba1cee3c2.tar.bz2
Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys: KWSys 2017-09-30 (f108739d)
Diffstat (limited to 'Source/kwsys/testSystemTools.cxx')
-rw-r--r--Source/kwsys/testSystemTools.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx
index 1871f5d..768eb4d 100644
--- a/Source/kwsys/testSystemTools.cxx
+++ b/Source/kwsys/testSystemTools.cxx
@@ -22,6 +22,7 @@
#include <iostream>
#include <sstream>
+#include <stdlib.h> /* free */
#include <string.h> /* strcmp */
#if defined(_WIN32) && !defined(__CYGWIN__)
#include <io.h> /* _umask (MSVC) / umask (Borland) */
@@ -535,15 +536,14 @@ static bool CheckStringOperations()
}
delete[] cres;
- char* cres2 = new char[strlen("Mary Had A Little Lamb.") + 1];
- strcpy(cres2, "Mary Had A Little Lamb.");
+ char* cres2 = strdup("Mary Had A Little Lamb.");
kwsys::SystemTools::ReplaceChars(cres2, "aeiou", 'X');
if (strcmp(cres2, "MXry HXd A LXttlX LXmb.")) {
std::cerr << "Problem with ReplaceChars "
<< "\"Mary Had A Little Lamb.\"" << std::endl;
res = false;
}
- delete[] cres2;
+ free(cres2);
if (!kwsys::SystemTools::StringStartsWith("Mary Had A Little Lamb.",
"Mary ")) {