std::basic_stringbuf::overflow() writes characters at the begin, but not at the 
current position if reallocation of internal buffer occurs
------------------------------------------------------------------------------------------------------------------------------------------

                 Key: STDCXX-795
                 URL: https://issues.apache.org/jira/browse/STDCXX-795
             Project: C++ Standard Library
          Issue Type: Bug
          Components: 27. Input/Output
    Affects Versions: 4.2.0
         Environment: All
            Reporter: Farid Zaripov
            Assignee: Farid Zaripov
             Fix For: 4.2.1


>From [http://www.mail-archive.com/[EMAIL PROTECTED]/msg00014.html]

The test below asserts on i = 513
{code:title=test.cpp}
#include <sstream>
#include <string>
#include <cassert>

int main ()
{
    std::ostringstream strm;
    std::string s;

    for (size_t i = 1; i <= 1024; ++i) {
        const char c = char (i);
        strm << c;
        s.push_back (c);
        assert (strm.str () == s);
    }

    return 0;
}
{code}

The test output:
{noformat}
test: test.cpp:14: int main (): Assertion `strm.str () == s' failed.
Aborted
{noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to