Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 41147 invoked from network); 4 Oct 2007 12:06:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Oct 2007 12:06:12 -0000 Received: (qmail 53150 invoked by uid 500); 4 Oct 2007 12:06:01 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 53132 invoked by uid 500); 4 Oct 2007 12:06:01 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 53113 invoked by uid 99); 4 Oct 2007 12:06:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Oct 2007 05:06:01 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Oct 2007 12:06:11 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 6DDEE714187 for ; Thu, 4 Oct 2007 05:05:51 -0700 (PDT) Message-ID: <7566691.1191499551432.JavaMail.jira@brutus> Date: Thu, 4 Oct 2007 05:05:51 -0700 (PDT) From: "Farid Zaripov (JIRA)" To: stdcxx-dev@incubator.apache.org Subject: [jira] Created: (STDCXX-576) std::basic_streambuf<>::xsputn() incorrectly inserts the data, that is the part of the internal buffer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org std::basic_streambuf<>::xsputn() incorrectly inserts the data, that is the part of the internal buffer ------------------------------------------------------------------------------------------------------ Key: STDCXX-576 URL: https://issues.apache.org/jira/browse/STDCXX-576 Project: C++ Standard Library Issue Type: Bug Components: 27. Input/Output Affects Versions: trunk Environment: All Reporter: Farid Zaripov Assignee: Farid Zaripov Fix For: 4.2 The test below aborts on assert. test.cpp: ------------------ #include // for stringbuf #include // for string #include // for assert() struct PubBuf: std::stringbuf { char* Pbase () const { return this->pbase (); } }; int main () { // 512 is the default buffer size of the basic_stringbuf std::string s (512, 'a'); std::stringbuf sbuf (s); PubBuf& buf = (PubBuf&)sbuf; std::streamsize res = buf.sputn (buf.Pbase (), 128); s.append (s.begin (), s.begin () + 128); const std::string& str = buf.str (); assert (res == 128); assert (str.size () == s.size ()); assert (str == s); return 0; } ------------------ The test output: ------------------ test: test.cpp:25: int main (): Assertion `str == s' failed. Aborted ------------------ -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.