Commit a1eca9bb0ce8893c3734d0a40939edce87c632e9

Stefan Sperling 2018-06-24T00:22:20

fix blank line and limit accounting in draw_tree_entries()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/tog/tog.c b/tog/tog.c
index 7878d7d..0020e29 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -1241,8 +1241,9 @@ draw_tree_entries(struct got_tree_entry **first_displayed_entry,
 	waddwstr(window, wline);
 	if (width < COLS)
 		waddch(window, '\n');
-	if (width < COLS)
-		waddch(window, '\n');
+	if (--limit <= 0)
+		return NULL;
+	waddch(window, '\n');
 	if (--limit <= 0)
 		return NULL;