summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdio/rget.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/rget.c')
-rw-r--r--newlib/libc/stdio/rget.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/newlib/libc/stdio/rget.c b/newlib/libc/stdio/rget.c
index 0444acee3..0a1cc147f 100644
--- a/newlib/libc/stdio/rget.c
+++ b/newlib/libc/stdio/rget.c
@@ -36,6 +36,10 @@ _DEFUN(__srget_r, (ptr, fp),
struct _reent *ptr _AND
register FILE *fp)
{
+ /* Ensure that any fake std stream is resolved before
+ we call __srefill_r so we may access the true read buffer. */
+ CHECK_INIT(fp);
+
if (__srefill_r (ptr, fp) == 0)
{
fp->_r--;