mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
gui/widget/textbox.cpp: fix string access outside of its size
This commit is contained in:
@@ -341,11 +341,11 @@ void CTextBox::refreshTextLineArray(void)
|
||||
//TRACE_1(" aktLine : %s\r\n",aktLine.c_str());
|
||||
//TRACE_1(" aktWidth: %d aktWordWidth:%d\r\n",aktWidth,aktWordWidth);
|
||||
|
||||
if( m_cText[pos] == '\n' ||
|
||||
if( ((pos < TextChars) && (m_cText[pos] == '\n')) ||
|
||||
loop == false)
|
||||
{
|
||||
// current line ends with an carriage return, make new line
|
||||
if (m_cText[pos] == '\n')
|
||||
if ((pos < TextChars) && (m_cText[pos] == '\n'))
|
||||
aktLine.erase(aktLine.size() - 1,1);
|
||||
m_cLineArray.push_back(aktLine);
|
||||
m_nNrOfLines++;
|
||||
|
Reference in New Issue
Block a user