store correct window dimensions for full-screen views
diff --git a/tog/tog.c b/tog/tog.c
index 81b2d4c..1d0d83d 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -117,8 +117,8 @@ open_view(int nlines, int ncols, int begin_y, int begin_x)
if (view == NULL)
return NULL;
- view->nlines = nlines;
- view->ncols = ncols;
+ view->nlines = nlines ? nlines : LINES - begin_y;
+ view->ncols = ncols ? ncols : COLS - begin_x;
view->begin_y = begin_y;
view->begin_x = begin_x;
view->window = newwin(nlines, ncols, begin_y, begin_x);