differing characters should be left untouched

This commit is contained in:
ceriel 1992-01-24 13:05:30 +00:00
parent 646bd0e51f
commit f3e5c3032f

View file

@ -204,7 +204,11 @@ _doscan(register FILE *stream, const char *format, va_list ap)
if (*format != '%') { if (*format != '%') {
ic = getc(stream); ic = getc(stream);
nrchars++; nrchars++;
if (ic != *format++) break; /* error */ if (ic != *format++) {
if (ic != EOF) ungetc(ic,stream);
nrchars--;
break; /* error */
}
continue; continue;
} }
format++; format++;