diff --git a/pdcurses/getstr.c b/pdcurses/getstr.c index d2ad351d..f43b5550 100644 --- a/pdcurses/getstr.c +++ b/pdcurses/getstr.c @@ -13,7 +13,7 @@ #include -RCSID("$Id: getstr.c,v 1.36 2006/10/29 15:22:39 wmcbrine Exp $"); +RCSID("$Id: getstr.c,v 1.37 2006/11/03 13:36:47 wmcbrine Exp $"); /*man-start************************************************************** @@ -108,8 +108,6 @@ int wgetnstr(WINDOW *win, char *str, int n) immediately */ win->_nodelay = FALSE; /* don't return -1 */ - wrefresh(win); - while (!stop) { ch = wgetch(win); @@ -203,6 +201,8 @@ int wgetnstr(WINDOW *win, char *str, int n) } } + wrefresh(win); + *p = '\0'; SP->echo = oldecho; /* restore old settings */ @@ -300,8 +300,6 @@ int wgetn_wstr(WINDOW *win, wint_t *wstr, int n) immediately */ win->_nodelay = FALSE; /* don't return -1 */ - wrefresh(win); - while (!stop) { ch = wgetch(win); @@ -395,6 +393,8 @@ int wgetn_wstr(WINDOW *win, wint_t *wstr, int n) } } + wrefresh(win); + *p = '\0'; SP->echo = oldecho; /* restore old settings */