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

<sstream>: Pass the correct size type to _Allocate_at_least_helper #4219

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Changes from all 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
8 changes: 4 additions & 4 deletions stl/inc/sstream
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,13 @@ protected:
}

// grow buffer and store element
size_t _Oldsize = 0;
const auto _Oldptr = _Mysb::eback();
_Mysize_type _Oldsize = 0;
const auto _Oldptr = _Mysb::eback();
if (_Pptr) {
_Oldsize = static_cast<size_t>(_Epptr - _Oldptr);
_Oldsize = static_cast<_Mysize_type>(_Epptr - _Oldptr);
}

size_t _Newsize;
_Mysize_type _Newsize;
if (_Oldsize < _MINSIZE) {
_Newsize = _MINSIZE;
} else if (_Oldsize < INT_MAX / 2) { // grow by 50 percent
Expand Down