1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-09 08:42:40 -05:00

Fix copy.

This commit is contained in:
XMRig
2019-03-16 13:32:00 +07:00
parent 1b9fbf1132
commit c94c0210f7

View File

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