Index: src/common/chromeos/string.cc |
diff --git a/src/common/chromeos/string.cc b/src/common/chromeos/string.cc |
index f447f85668d2f509212fa3b323bbcef793c0d179..c70e0656cca2cc4819c7cb40e6d8da9207036c1f 100644 |
--- a/src/common/chromeos/string.cc |
+++ b/src/common/chromeos/string.cc |
@@ -4,8 +4,9 @@ |
#include <chromeos/string.h> |
-#include <pcrecpp.h> |
+#include <cstring> |
+#include <pcrecpp.h> |
#include "base/logging.h" |
namespace chromeos { |
@@ -45,5 +46,11 @@ void SplitStringUsing(const std::string& str, |
} |
} |
+char* NewStringCopy(const char* x) { |
+ char* result = static_cast<char*>(::operator new(std::strlen(x) + 1)); |
+ std::strcpy(result, x); // NOLINT |
+ return result; |
+} |
+ |
} // namespace chromeos |