summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/CBot/CBotString.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/CBot/CBotString.cpp b/src/CBot/CBotString.cpp
index e52cd05..6f48127 100644
--- a/src/CBot/CBotString.cpp
+++ b/src/CBot/CBotString.cpp
@@ -357,9 +357,9 @@ const CBotString& CBotString::operator+(const CBotString& stringSrc)
{
char* p = static_cast<char*>(malloc(m_lg+stringSrc.m_lg+1));
- strcpy(p, m_ptr);
+ if (m_ptr!=NULL) strcpy(p, m_ptr);
char* pp = p + m_lg;
- strcpy(pp, stringSrc.m_ptr);
+ if (stringSrc.m_ptr!=NULL) strcpy(pp, stringSrc.m_ptr);
free(m_ptr);
m_ptr = p;