Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fstream.seekp(0, ios::cur) #3773

Merged
merged 22 commits into from
Jun 22, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions stl/inc/__msvc_filebuf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,8 +651,7 @@ class basic_filebuf : public basic_streambuf<_Elem, _Traits> { // stream buffer
_Off -= static_cast<off_type>(sizeof(_Elem)); // back up over _Elem bytes
}

if (!_Myfile || !_Endwrite()
|| ((_Off != 0 || _Way != ios_base::cur) && _CSTD _fseeki64(_Myfile, _Off, _Way) != 0)
if (!_Myfile || !_Endwrite() || _CSTD _fseeki64(_Myfile, _Off, _Way) != 0
|| _CSTD fgetpos(_Myfile, &_Fileposition) != 0) {
return pos_type{off_type{-1}}; // report failure
}
Expand Down