mirror of
https://github.com/xmrig/xmrig.git
synced 2024-11-05 16:07:42 +00:00
Fix copy.
This commit is contained in:
parent
1b9fbf1132
commit
c94c0210f7
1 changed files with 3 additions and 7 deletions
|
@ -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 a new issue