summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r--lib/libc/stdio/ungetc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libc/stdio/ungetc.c b/lib/libc/stdio/ungetc.c
index 9ede083..0113161 100644
--- a/lib/libc/stdio/ungetc.c
+++ b/lib/libc/stdio/ungetc.c
@@ -99,6 +99,7 @@ ungetc(int c, FILE *fp)
if (!__sdidinit)
__sinit();
FLOCKFILE(fp);
+ ORIENT(fp, -1);
ret = __ungetc(c, fp);
FUNLOCKFILE(fp);
return (ret);
@@ -111,8 +112,6 @@ int
__ungetc(int c, FILE *fp)
{
- ORIENT(fp, -1);
-
if (c == EOF)
return (EOF);
if ((fp->_flags & __SRD) == 0) {
OpenPOWER on IntegriCloud