Matthew Dempsky: Same as stdexcept.cpp in libc++abi: we've already computed 'len strlen(msg)', so we can use memcpy() instead of strcpy().
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185274 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a9602d56de
commit
09ca5d49e1
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user