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
This commit is contained in:
Howard Hinnant 2013-06-29 23:53:20 +00:00
parent 660f2ae422
commit 27841fd803
1 changed files with 1 additions and 1 deletions

View File

@ -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