diff options
Diffstat (limited to 'newlib/libc/stdio/ungetc.c')
-rw-r--r-- | newlib/libc/stdio/ungetc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/newlib/libc/stdio/ungetc.c b/newlib/libc/stdio/ungetc.c index 9ccd027..fc6fa31 100644 --- a/newlib/libc/stdio/ungetc.c +++ b/newlib/libc/stdio/ungetc.c @@ -77,14 +77,14 @@ _DEFUN(_ungetc_r, (rptr, c, fp), if (c == EOF) return (EOF); - _flockfile (fp); - /* Ensure stdio has been initialized. ??? Might be able to remove this as some other stdio routine should have already been called to get the char we are un-getting. */ - CHECK_INIT (fp); + CHECK_INIT (rptr); + _flockfile (fp); + /* After ungetc, we won't be at eof anymore */ fp->_flags &= ~__SEOF; |