Explorar o código

prevent bottom from set to NULL again

Jan Klemkow %!s(int64=6) %!d(string=hai) anos
pai
achega
3e513e8da1
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      scroll.c

+ 4 - 1
scroll.c

@@ -188,8 +188,11 @@ scrollup(void)
 
 	/* print one page */
 	for (; rows > ws.ws_row - first;) {
-		if ((bottom = TAILQ_PREV(bottom, tailhead, entries)) == NULL)
+		if (TAILQ_PREV(bottom, tailhead, entries) != NULL)
+			bottom = TAILQ_PREV(bottom, tailhead, entries);
+		else
 			break;
+
 		if (--rows > ws.ws_row - first)
 			write(STDOUT_FILENO, bottom->buf, bottom->size);
 		else /* last line w/o "/r/n" */