Skip to content

Commit

Permalink
<sstream>: Pass the correct size type to _Allocate_at_least_helper (
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanTLavavej authored Nov 29, 2023
1 parent 14f3b2d commit 96c1e08
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 96c1e08

Please sign in to comment.