Fix re-initialization of FILE flags and mbstate in freopen
* libc/stdio/freopen.c (_freopen_r): Only reset __SWID bit per SUSv4. * libc/stdio64/freopen64.c (_freopen64_r): Add missing resetting of flag values and _mbstate. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
@ -209,7 +209,7 @@ _DEFUN(_freopen_r, (ptr, file, mode, fp),
|
||||
FREELB (ptr, fp);
|
||||
fp->_lb._size = 0;
|
||||
fp->_flags &= ~__SORD;
|
||||
fp->_flags2 = 0;
|
||||
fp->_flags2 &= ~__SWID;
|
||||
memset (&fp->_mbstate, 0, sizeof (_mbstate_t));
|
||||
|
||||
if (f < 0)
|
||||
|
Reference in New Issue
Block a user