differing characters should be left untouched

This commit is contained in:
ceriel 1992-01-24 13:05:30 +00:00
parent 7e63c4818f
commit 1803c56862

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++;