1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-12-22 00:56:26 -05:00

Do not use a temporary buffer to prompt user in mlyesno, thus avoiding problem with '%' or overflow.

This commit is contained in:
Renaud 2015-01-16 17:55:23 +08:00
parent 434c9ba7ab
commit 5fda2735a5

View File

@ -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();