summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-09-29 22:04:39 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-09-29 22:04:39 +0200
commitc8f39a4c96ab63f9e3edc96845e1b70c89b95d2b (patch)
tree4d3a79b77e7aa8c077cc3742eee3758e26550eff /src
parent86109a8c1e6fcee846054163a1ed640d6de75ec5 (diff)
downloadcolobot-c8f39a4c96ab63f9e3edc96845e1b70c89b95d2b.tar.gz
colobot-c8f39a4c96ab63f9e3edc96845e1b70c89b95d2b.tar.bz2
colobot-c8f39a4c96ab63f9e3edc96845e1b70c89b95d2b.zip
Fixed CEdit delete[] issues
Diffstat (limited to 'src')
-rw-r--r--src/ui/edit.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ui/edit.cpp b/src/ui/edit.cpp
index 27ef576..ca53a7a 100644
--- a/src/ui/edit.cpp
+++ b/src/ui/edit.cpp
@@ -1483,7 +1483,7 @@ bool CEdit::ReadText(const char *filename, int addSize)
FreeImage();
if (m_text != nullptr)
- delete m_text;
+ delete[] m_text;
m_text = new char[m_maxChar+1];
memset(m_text, 0, m_maxChar+1);
@@ -1516,7 +1516,7 @@ bool CEdit::ReadText(const char *filename, int addSize)
{
m_text[j] = buffer[i];
//if ( m_format.size() > 0 )
- m_format[j] = font;
+ m_format[j] = font;
j ++;
}
i ++;
@@ -1857,7 +1857,7 @@ bool CEdit::ReadText(const char *filename, int addSize)
{
m_text[j] = buffer[i];
//if ( m_format.size() > 0 )
- m_format[j] = font;
+ m_format[j] = font;
j ++;
}
i ++;
@@ -1873,7 +1873,7 @@ bool CEdit::ReadText(const char *filename, int addSize)
m_len = j;
m_imageTotal = iIndex;
- delete buffer;
+ delete[] buffer;
Justif();
ColumnFix();
@@ -3320,8 +3320,8 @@ bool CEdit::SetFormat(int cursor1, int cursor2, int format)
for ( i=cursor1 ; i<cursor2 ; i++ )
{
- if (m_format.count(i))
- m_format[i] |= format;
+ if (m_format.count(i))
+ m_format[i] |= format;
}
return true;