Avoid calling mlwrite with computed string as format parameter.

This commit is contained in:
Renaud 2015-02-15 17:32:13 +08:00
parent 2b8992350d
commit e556f7714b
2 changed files with 4 additions and 9 deletions

View File

@ -512,7 +512,7 @@ int getstring( const char *prompt, char *buf, int nbuf, int eolchar)
quotef = FALSE;
/* prompt the user for the input string */
mlwrite(prompt);
mlwrite( "%s", prompt);
for (;;) {
#if COMPLC

View File

@ -909,9 +909,9 @@ static int replaces(int kind, int f, int n)
if (kind) {
/* Get the query.
*/
pprompt:
mloutfmt( &tpat[ 0], &pat[ 0], &rpat[ 0]) ;
qprompt:
pprompt:
mloutstr( tpat) ;
qprompt:
update(TRUE); /* show the proposed place to change */
c = tgetc(); /* and input */
mloutstr( "") ; /* and clear it */
@ -1090,12 +1090,7 @@ int expandp(char *srcstr, char *deststr, int maxlength)
*deststr++ = '^';
*deststr++ = c ^ 0x40;
maxlength -= 2;
} else if (c == '%') {
*deststr++ = '%';
*deststr++ = '%';
maxlength -= 2;
} else { /* any other character */
*deststr++ = c;
maxlength--;
}