Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 45318 invoked from network); 14 Aug 2007 15:47:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Aug 2007 15:47:39 -0000 Received: (qmail 29832 invoked by uid 500); 14 Aug 2007 15:47:37 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 29820 invoked by uid 500); 14 Aug 2007 15:47:37 -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 29808 invoked by uid 99); 14 Aug 2007 15:47:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Aug 2007 08:47:36 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.30.140.160] (HELO moroha.quovadx.com) (208.30.140.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Aug 2007 15:47:47 +0000 Received: from qxvcexch01.ad.quovadx.com ([192.168.170.59]) by moroha.quovadx.com (8.13.6/8.13.6) with ESMTP id l7EFlB2f001804 for ; Tue, 14 Aug 2007 15:47:11 GMT Received: from [10.70.3.113] ([10.70.3.113]) by qxvcexch01.ad.quovadx.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 14 Aug 2007 09:46:03 -0600 Message-ID: <46C1CE7F.5020702@roguewave.com> Date: Tue, 14 Aug 2007 09:47:11 -0600 From: Martin Sebor Organization: Rogue Wave Software, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4 MIME-Version: 1.0 To: stdcxx-dev@incubator.apache.org Subject: Re: [PATCH] STDCXX-515 References: <7BDB2168BEAEF14C98F1901FD2DE6438C9161C@epmsa009.minsk.epam.com> In-Reply-To: <7BDB2168BEAEF14C98F1901FD2DE6438C9161C@epmsa009.minsk.epam.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 14 Aug 2007 15:46:03.0925 (UTC) FILETIME=[38915450:01C7DE8A] X-Virus-Checked: Checked by ClamAV on apache.org Farid Zaripov wrote: > Below is the patch for fix STDCXX-515. > > ChangeLog: > * sstream.cc (xsputn): Correct write position after growing the > buffer. Why do we need to do it in xsputn()? Isn't str() supposed to keep pptr() at the right offset after growing the buffer? Martin > > Index: sstream.cc > =================================================================== > --- sstream.cc (revision 564229) > +++ sstream.cc (working copy) > @@ -185,10 +185,16 @@ > const _RWSTD_SIZE_T __bufsize = > __n + (this->pptr () - this->pbase ()); > > + // preserve current pptr() since str() would seek to end > + const streamsize __cur = this->pptr () - this->pbase (); > + > // grow the buffer if necessary to accommodate the whole > // string plus the contents of the buffer up to pptr() > str (this->_C_buffer, __bufsize); > > + // restore pptr() > + this->pbump (__cur - (this->pptr () - this->pbase ())); > + > _RWSTD_ASSERT (__n <= this->epptr () - this->pptr ()); > } > > > Farid.