Skip to content

Commit

Permalink
subwin() made the subwindow one row/line too small when fed nlines=0 …
Browse files Browse the repository at this point in the history
…or ncols=0. Fix for issue #265.
  • Loading branch information
Bill-Gray committed Jan 6, 2023
1 parent ddb2ae4 commit 9d1a733
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pdcurses/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,9 @@ WINDOW *subwin(WINDOW *orig, int nlines, int ncols, int begy, int begx)
k = begx - orig->_begx;

if (!nlines)
nlines = orig->_maxy - 1 - j;
nlines = orig->_maxy - j;
if (!ncols)
ncols = orig->_maxx - 1 - k;
ncols = orig->_maxx - k;

win = PDC_makenew(nlines, ncols, begy, begx);
if (!win)
Expand Down

0 comments on commit 9d1a733

Please sign in to comment.