Jochen Sprickerhof преди 6 години
родител
ревизия
82d78a619a
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      scroll.c

+ 2 - 2
scroll.c

@@ -172,7 +172,7 @@ scrollup(void)
 	if (bottom == NULL)
 		bottom = TAILQ_LAST(&head, tailhead);
 
-	if (rows - ws.ws_row <= 0) {
+	if (rows - ws.ws_row < 0) {
 		bottom = TAILQ_FIRST(&head);
 		return;
 	}
@@ -197,7 +197,7 @@ scrolldown(void)
 	int rows = ws.ws_row;
 
 	/* print one page */
-	for (; rows >= 0 && TAILQ_PREV(bottom, tailhead, entries) != NULL; rows--) {
+	for (; rows > 0 && TAILQ_PREV(bottom, tailhead, entries) != NULL; rows--) {
 		bottom = TAILQ_PREV(bottom, tailhead, entries);
 		write(STDOUT_FILENO, bottom->buf, bottom->size);
 	}