Commit af20d278 authored by Kurt Hindenburg's avatar Kurt Hindenburg
Browse files

check to handle issue w/ fillWithDefaultChar given huge -count

    Previously, the count could be a huge negative number which could
    exceed what an int can handle.  Also, there's no reason to calculate
    this number if it will be negative.

    CCBUG: 246484
parent 4d3a22cc
......@@ -84,6 +84,12 @@ void ScreenWindow::fillUnusedArea()
int windowEndLine = currentLine() + windowLines() - 1;
int unusedLines = windowEndLine - screenEndLine;
// stop when unusedLines is negative; there is an issue w/ charsToFill
// being greater than an int can hold
if (unusedLines <= 0)
return;
int charsToFill = unusedLines * windowColumns();
Screen::fillWithDefaultChar(_windowBuffer + _windowBufferSize - charsToFill, charsToFill);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment