fix blank line and limit accounting in draw_tree_entries()
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;