From 0bf3fc3ec2e8226dcbc086fdbfcb8da4f813041e Mon Sep 17 00:00:00 2001 From: William McBrine Date: Fri, 28 Feb 2014 17:35:45 +0000 Subject: [PATCH] Potentially invalid saved cursor position in resize_window() -- another off-by-one _maxx/_maxy error. Patch after "Luke-Jr". --- pdcurses/window.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pdcurses/window.c b/pdcurses/window.c index 231c5a32..0cdae202 100644 --- a/pdcurses/window.c +++ b/pdcurses/window.c @@ -2,7 +2,7 @@ #include -RCSID("$Id: window.c,v 1.63 2012/05/11 16:48:28 wmcbrine Exp $") +RCSID("$Id: window.c,v 1.64 2014/02/28 17:35:45 wmcbrine Exp $") /*man-start************************************************************** @@ -464,8 +464,8 @@ WINDOW *resize_window(WINDOW *win, int nlines, int ncols) return (WINDOW *)NULL; } - save_curx = min(win->_curx, new->_maxx); - save_cury = min(win->_cury, new->_maxy); + save_curx = min(win->_curx, (new->_maxx - 1)); + save_cury = min(win->_cury, (new->_maxy - 1)); if (!(win->_flags & (_SUBPAD|_SUBWIN))) {