Selaa lähdekoodia

Fix scrolling offset

Jochen Sprickerhof 6 vuotta sitten
vanhempi
commit
82d78a619a
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  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);
 	}