diff --git a/src/textdialog.cpp b/src/textdialog.cpp index c4f1d19..093131d 100644 --- a/src/textdialog.cpp +++ b/src/textdialog.cpp @@ -144,7 +144,8 @@ void TextDialog::exec() { if (firstRow + rowsPerPage*2 -1 < text->size()) { firstRow += rowsPerPage-1; } else { - firstRow = max(0ul, (unsigned long) (text->size() - rowsPerPage)); + firstRow = text->size() < rowsPerPage ? + 0 : text->size() - rowsPerPage; } break; case InputManager::SETTINGS: