From 601c9373efc2b6c25d62d63820136bc260ec93cb Mon Sep 17 00:00:00 2001 From: William McBrine Date: Mon, 26 Jun 2023 01:44:33 -0400 Subject: [PATCH] "subwin() made the subwindow one row/line too small when fed nlines=0 or ncols=0.", by B.G. --- pdcurses/window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdcurses/window.c b/pdcurses/window.c index fec5af98..9f425561 100644 --- a/pdcurses/window.c +++ b/pdcurses/window.c @@ -344,9 +344,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)