From 9d1a7338b0e5cff81475b71283c87f9e7588224c Mon Sep 17 00:00:00 2001 From: Bill-Gray Date: Fri, 6 Jan 2023 12:09:13 -0500 Subject: [PATCH] subwin() made the subwindow one row/line too small when fed nlines=0 or ncols=0. Fix for issue #265. --- pdcurses/window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdcurses/window.c b/pdcurses/window.c index 28d90ac8..70f94b71 100644 --- a/pdcurses/window.c +++ b/pdcurses/window.c @@ -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)