Prevent undefined memcpy calls
This commit is contained in:
parent
f6d44c38fc
commit
8d51604f02
@ -139,8 +139,10 @@ namespace rexy{
|
||||
if(newsize < m_cap)
|
||||
return false;
|
||||
string_intermediary tmp(newsize);
|
||||
if(m_data){
|
||||
memcpy(tmp.get(), m_data, m_length);
|
||||
tmp[m_length] = 0;
|
||||
}
|
||||
*this = std::move(tmp);
|
||||
return true;
|
||||
}
|
||||
@ -152,6 +154,7 @@ namespace rexy{
|
||||
m_data[m_length] = 0;
|
||||
}else{
|
||||
string_intermediary tmp(detail::max(m_length + len, m_cap*2));
|
||||
if(m_data)
|
||||
memcpy(tmp.m_data, m_data, m_length);
|
||||
memcpy(tmp.m_data+m_length, data, len);
|
||||
tmp.m_length = len+m_length;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user