about summary refs log tree commit diff
path: root/libio
diff options
context:
space:
mode:
Diffstat (limited to 'libio')
-rw-r--r--libio/genops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libio/genops.c b/libio/genops.c
index 42419bf508..c86adee4c0 100644
--- a/libio/genops.c
+++ b/libio/genops.c
@@ -368,7 +368,7 @@ _IO_doallocbuf (fp)
 {
   if (fp->_IO_buf_base)
     return;
-  if (!(fp->_flags & _IO_UNBUFFERED))
+  if (!(fp->_flags & _IO_UNBUFFERED) || fp->_mode > 0)
     if (_IO_DOALLOCATE (fp) != EOF)
       return;
   _IO_setb (fp, fp->_shortbuf, fp->_shortbuf+1, 0);