yet another fix in freopen: re-opening for reading did not work properly

This commit is contained in:
ceriel 1987-09-02 12:43:23 +00:00
parent a1ae336247
commit c93f6d9fb1

View file

@ -51,7 +51,7 @@ register FILE *fp;
return NULL; return NULL;
} }
fp->_count = 0; fp->_count = 0;
if (fp->_buf) fp->_count = BUFSIZ; if (fp->_buf && (flags | IO_WRITEMODE)) fp->_count = BUFSIZ;
fp->_fd = fd; fp->_fd = fd;
fp->_flags = flags; fp->_flags = flags;
return(fp); return(fp);