diff options
Diffstat (limited to 'lib/libc/stdio/ungetc.c')
-rw-r--r-- | lib/libc/stdio/ungetc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libc/stdio/ungetc.c b/lib/libc/stdio/ungetc.c index f70fb42..092debd 100644 --- a/lib/libc/stdio/ungetc.c +++ b/lib/libc/stdio/ungetc.c @@ -132,6 +132,10 @@ __ungetc(int c, FILE *fp) } fp->_flags |= __SRD; } + + if (!(fp->_flags & __SSTR) && _ftello(fp) == 0) + return (EOF); + c = (unsigned char)c; /* |