From dfa76786b339f20b8c335e479715d66fd21ffc5c Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 17 Jun 2008 01:37:05 +0000 Subject: [PATCH] Fixed incorrect access of new lines in AddEmptyLines(). The wrong lines would be initialized while the right ones might have remained uninitialized. Could happen only in case that more lines were scrolled out of the screen than there were in the scroll region. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25985 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/terminal/HistoryBuffer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/apps/terminal/HistoryBuffer.cpp b/src/apps/terminal/HistoryBuffer.cpp index 98e1cb7603..63cafb7f03 100644 --- a/src/apps/terminal/HistoryBuffer.cpp +++ b/src/apps/terminal/HistoryBuffer.cpp @@ -207,7 +207,8 @@ HistoryBuffer::AddEmptyLines(int32 count) = (AttributesRun*)(fBuffer + fBufferAllocationOffset); for (int32 i = 0; i < count; i++) { - HistoryLine* line = _LineAt(fNextLine++); + HistoryLine* line = &fLines[fNextLine]; + fNextLine = (fNextLine + 1) % fCapacity; line->attributesRuns = attributesRun; line->attributesRunCount = 0; line->byteLength = 0;