Review formatted string printing when '%' is at end of string.

Clean up unused IO return code.
This commit is contained in:
Renaud 2016-04-05 11:33:38 +08:00
parent 16e6f87ad5
commit f83ab08609
2 changed files with 9 additions and 9 deletions

View File

@ -1333,12 +1333,14 @@ void vmlwrite( const char *fmt, va_list ap) {
movecursor( term.t_nrow, 0) ;
mpresf = *fmt ? TRUE : FALSE ; /* flag if line has content or not */
while ((c = *fmt++) != 0) {
if (c != '%')
while( ( c = *fmt++) != 0)
if( c != '%')
mlputc( c) ;
else {
c = *fmt++;
switch (c) {
else if( ( c = *fmt++) == 0) {
mlputc( '%') ;
break ;
} else
switch( c) {
case 'd':
mlputi(va_arg(ap, int), 10);
break;
@ -1369,11 +1371,10 @@ void vmlwrite( const char *fmt, va_list ap) {
default:
mlputc( '%') ;
/* fallthrough */
case '%':
mlputc( c) ;
}
}
}
/* if we can, erase to the end of screen */
if( eolexist == TRUE && ttcol < term.t_ncol)

View File

@ -6,8 +6,7 @@ typedef enum {
FIOFNF, /* File I/O, file not found. */
FIOEOF, /* File I/O, end of file. */
FIOERR, /* File I/O, error. */
FIOMEM, /* File I/O, out of memory */
FIOFUN /* File I/O, eod of file/bad line */
FIOMEM /* File I/O, out of memory */
} fio_code ;
#define FTYPE_NONE 0