From c8f39a4c96ab63f9e3edc96845e1b70c89b95d2b Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Sat, 29 Sep 2012 22:04:39 +0200 Subject: Fixed CEdit delete[] issues --- src/ui/edit.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') 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