Fix copy.
This commit is contained in:
parent
1b9fbf1132
commit
c94c0210f7
@ -178,14 +178,10 @@ void xmrig::String::copy(const char *str)
|
|||||||
|
|
||||||
void xmrig::String::copy(const String &other)
|
void xmrig::String::copy(const String &other)
|
||||||
{
|
{
|
||||||
if (m_size > 0) {
|
if (m_size > 0 && m_size == other.m_size) {
|
||||||
if (m_size == other.m_size) {
|
memcpy(m_data, other.m_data, m_size + 1);
|
||||||
memcpy(m_data, other.m_data, m_size + 1);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
delete [] m_data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete [] m_data;
|
delete [] m_data;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user