Commit Diff


commit - 97ddc14653c4e9867c310b35fea2cc60193d1ed0
commit + 207b902917225df5218132215b78bd2ac551cd87
blob - 81b2d4c4fd744800b52aedc425c21e17b144f728
blob + 1d0d83dad3ae29243c884860c5a89336d72d5da0
--- tog/tog.c
+++ tog/tog.c
@@ -117,8 +117,8 @@ open_view(int nlines, int ncols, int begin_y, int begi
 	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);