mirror of
https://github.com/rfivet/uemacs.git
synced 2024-12-18 23:36:23 -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)
|
int mlyesno( const char *prompt)
|
||||||
{
|
{
|
||||||
char c; /* input character */
|
char c; /* input character */
|
||||||
char buf[ NSTRING] ; /* prompt to user */
|
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
/* build and prompt the user */
|
/* prompt the user */
|
||||||
strcpy(buf, prompt);
|
mlwrite( "%s (y/n)? ", prompt) ;
|
||||||
strcat(buf, " (y/n)? ");
|
|
||||||
mlwrite(buf);
|
|
||||||
|
|
||||||
/* get the response */
|
/* get the response */
|
||||||
c = tgetc();
|
c = tgetc();
|
||||||
|
Loading…
Reference in New Issue
Block a user