X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/9385eb3d10ebe5eb398c52040ec3dbfba9b0cdcf..34e8f8296870d0e8695f90e1a54240a589d41312:/stdio/FreeBSD/ungetc.c diff --git a/stdio/FreeBSD/ungetc.c b/stdio/FreeBSD/ungetc.c index c98ab5a..2217259 100644 --- a/stdio/FreeBSD/ungetc.c +++ b/stdio/FreeBSD/ungetc.c @@ -38,7 +38,7 @@ static char sccsid[] = "@(#)ungetc.c 8.2 (Berkeley) 11/3/93"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/stdio/ungetc.c,v 1.14 2002/08/13 09:30:41 tjr Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdio/ungetc.c,v 1.16 2004/03/10 12:41:11 tjr Exp $"); #include "namespace.h" #include @@ -96,11 +96,10 @@ ungetc(int c, FILE *fp) { int ret; - if (c == EOF) - return (EOF); if (!__sdidinit) __sinit(); FLOCKFILE(fp); + ORIENT(fp, -1); ret = __ungetc(c, fp); FUNLOCKFILE(fp); return (ret); @@ -113,8 +112,6 @@ int __ungetc(int c, FILE *fp) { - ORIENT(fp, -1); - if (c == EOF) return (EOF); if ((fp->_flags & __SRD) == 0) {