diff options
author | erihel <erihel@gmail.com> | 2013-02-11 20:17:43 +0100 |
---|---|---|
committer | erihel <erihel@gmail.com> | 2013-02-11 20:17:43 +0100 |
commit | c7371da676a29def020a6c247ad1b3c47040fc90 (patch) | |
tree | c10a4cbffd371753637cd939ac388af0e8ce424e /src | |
parent | 3f6a6a9eefc54452dc99a15f67bdfabc7e19788b (diff) | |
download | colobot-c7371da676a29def020a6c247ad1b3c47040fc90.tar.gz colobot-c7371da676a29def020a6c247ad1b3c47040fc90.tar.bz2 colobot-c7371da676a29def020a6c247ad1b3c47040fc90.zip |
* Fixed crash when inputing cheats
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/edit.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ui/edit.cpp b/src/ui/edit.cpp index 792e4a9..0e50852 100644 --- a/src/ui/edit.cpp +++ b/src/ui/edit.cpp @@ -2836,20 +2836,20 @@ void CEdit::InsertOne(char character) { m_text[i] = m_text[i-1]; // shoot - //if ( m_format.size() > 0 ) - //{ + if ( m_format.size() > static_cast<unsigned int>(i) ) + { m_format[i] = m_format[i-1]; // shoot - //} + } } m_len ++; m_text[m_cursor1] = character; - //if ( m_format.size() > 0 ) - //{ + if ( m_format.size() > static_cast<unsigned int>(m_cursor1) ) + { m_format[m_cursor1] = 0; - //} + } m_cursor1++; m_cursor2 = m_cursor1; |