mirror of
https://github.com/rfivet/uemacs.git
synced 2024-11-16 09:36:29 -05:00
Do not use a temporary buffer to prompt user in mlyesno, thus avoiding problem with '%' or overflow.
This commit is contained in:
parent
434c9ba7ab
commit
5fda2735a5
7
input.c
7
input.c
@ -61,13 +61,10 @@ static const int quotec = 0x11 ; /* quote char during mlreply() */
|
||||
int mlyesno( const char *prompt)
|
||||
{
|
||||
char c; /* input character */
|
||||
char buf[ NSTRING] ; /* prompt to user */
|
||||
|
||||
for (;;) {
|
||||
/* build and prompt the user */
|
||||
strcpy(buf, prompt);
|
||||
strcat(buf, " (y/n)? ");
|
||||
mlwrite(buf);
|
||||
/* prompt the user */
|
||||
mlwrite( "%s (y/n)? ", prompt) ;
|
||||
|
||||
/* get the response */
|
||||
c = tgetc();
|
||||
|
Loading…
Reference in New Issue
Block a user