fixed bug with %[] in doscan.c

This commit is contained in:
ceriel 1996-04-01 09:08:59 +00:00
parent 3895a59e03
commit 73b54a2326

View file

@ -381,9 +381,10 @@ _doscan(register FILE *stream, const char *format, va_list ap)
else Xtable['-'] = 1; else Xtable['-'] = 1;
} }
} }
if (!*format) return done; if (!*format || !(Xtable[ic] ^ reverse)) {
if (ic != EOF) ungetc(ic, stream);
if (!(Xtable[ic] ^ reverse)) return done; return done;
}
if (!(flags & FL_NOASSIGN)) if (!(flags & FL_NOASSIGN))
str = va_arg(ap, char *); str = va_arg(ap, char *);