Skip to content

Commit de0bdf0

Browse files
author
Bret Ambrose
committed
More streambuf failures
1 parent 75e97c5 commit de0bdf0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

aws-cpp-sdk-core/source/utils/stream/SimpleStreamBuf.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ std::streampos SimpleStreamBuf::seekpos(std::streampos pos, std::ios_base::openm
108108

109109
if (which == std::ios_base::in)
110110
{
111-
setg(m_buffer, m_buffer + static_cast<size_t>(pos), egptr());
111+
setg(m_buffer, m_buffer + static_cast<size_t>(pos), pptr());
112112
}
113113

114114
if (which == std::ios_base::out)
@@ -195,6 +195,7 @@ std::streamsize SimpleStreamBuf::xsputn(const char* s, std::streamsize n)
195195
memcpy(current_pptr, s + writeCount, copySize);
196196
writeCount += copySize;
197197
setp(current_pptr + copySize, current_epptr);
198+
setg(m_buffer, gptr(), pptr());
198199
}
199200
else if (overflow(std::char_traits< char >::to_int_type(*(s + writeCount))) != std::char_traits<char>::eof())
200201
{

0 commit comments

Comments
 (0)