xref: /original-bsd/lib/libcurses/getstr.c (revision c35f7ea3)
1 # include	"curses.ext"
2 
3 /*
4  *	This routine gets a string starting at (_cury,_curx)
5  *
6  * 04/29/81 (Berkeley) @(#)getstr.c	1.3
7  */
8 wgetstr(win,str)
9 reg WINDOW	*win;
10 reg char	*str; {
11 
12 	while ((*str = wgetch(win)) != ERR && *str != '\n');
13 		str++;
14 	if (*str == ERR) {
15 		*str = '\0';
16 		return ERR;
17 	}
18 	*str = '\0';
19 	return OK;
20 }
21