diff options
author | Howard Hinnant <hhinnant@apple.com> | 2013-06-29 23:53:20 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2013-06-29 23:53:20 +0000 |
commit | 27841fd803ca0b8c81dcacccddf879b0dafd7f66 (patch) | |
tree | aa4204d8c57eec345e7654cba0aaf50b8e6d2fa8 /libcxx/src/stdexcept.cpp | |
parent | 660f2ae422bcf336a435e8dd661e8458ab786890 (diff) | |
download | llvm-27841fd803ca0b8c81dcacccddf879b0dafd7f66.zip llvm-27841fd803ca0b8c81dcacccddf879b0dafd7f66.tar.gz llvm-27841fd803ca0b8c81dcacccddf879b0dafd7f66.tar.bz2 |
Matthew Dempsky: Same as stdexcept.cpp in libc++abi: we've already computed 'len strlen(msg)', so we can use memcpy() instead of strcpy().
llvm-svn: 185274
Diffstat (limited to 'libcxx/src/stdexcept.cpp')
-rw-r--r-- | libcxx/src/stdexcept.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libcxx/src/stdexcept.cpp b/libcxx/src/stdexcept.cpp index 0c4e832..8d25f3e 100644 --- a/libcxx/src/stdexcept.cpp +++ b/libcxx/src/stdexcept.cpp @@ -61,7 +61,7 @@ __libcpp_nmstr::__libcpp_nmstr(const char* msg) c[0] = c[1] = len; str_ += offset; count() = 0; - std::strcpy(const_cast<char*>(c_str()), msg); + std::memcpy(const_cast<char*>(c_str()), msg, len + 1); } inline |