Return-Path: Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: (qmail 47683 invoked from network); 15 Apr 2008 01:36:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Apr 2008 01:36:41 -0000 Received: (qmail 33855 invoked by uid 500); 15 Apr 2008 01:36:42 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 33844 invoked by uid 500); 15 Apr 2008 01:36:42 -0000 Mailing-List: contact dev-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list dev@stdcxx.apache.org Received: (qmail 33835 invoked by uid 99); 15 Apr 2008 01:36:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Apr 2008 18:36:42 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.30.140.160] (HELO moroha.roguewave.com) (208.30.140.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Apr 2008 01:36:00 +0000 Received: from exchmail01.Blue.Roguewave.Com (exchmail01.blue.roguewave.com [10.22.129.22]) by moroha.roguewave.com (8.13.6/8.13.6) with ESMTP id m3F1aBUi020943 for ; Tue, 15 Apr 2008 01:36:12 GMT X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: RE: svn commit: r647908 - in /stdcxx/trunk/tests: self/0.printf.cpp src/fmt_defs.h src/printf.cpp Date: Mon, 14 Apr 2008 19:36:06 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: svn commit: r647908 - in /stdcxx/trunk/tests: self/0.printf.cpp src/fmt_defs.h src/printf.cpp Thread-Index: AcieeIGgNe9/J1XtQYGZ6oya1JaOsAABqJTQAAWuJrA= References: <20080414171556.87A691A9832@eris.apache.org> <48039BE0.4020702@roguewave.com> <4803BD77.5020405@roguewave.com> <4803CF95.5010801@roguewave.com> From: "Travis Vitek" To: X-Virus-Checked: Checked by ClamAV on apache.org Travis Vitek wrote: > >Unless I'm totally misunderstanding you (it seems that I may be), this >would limit maximum command line length to 256 characters. > Okay, I think I'm finally seeing the light. My understanding of how this was intended to work was totally wrong. I had mistakenly thought that if the maxsize format specifier (%{*} or %{n}) wasn't provided that rw_vasnprintf() would intellegently switch to a dynamic buffer and leave the original user provided buffer alone. I now understand that if the caller uses a static buffer, they are expected (required) to indicate maximum number of characters to be written to the buffer using the previously mentioned format specifier. With that specifier, maxsize would get set and the guard check and free() call are avoided. The guard bytes that were added in [r351515|http://svn.apache.org/viewvc?view=3Drev&revision=3D351515] will usually detect that a buffer was not allocated with a previous call to _rw_bufcat(), and the assertion will trigger. Unfortunately there wasn't a comment there to indicate that this was expected behavior and that the caller was using the function improperly. So after a whole day of this I think I have the appropriate solution. It is consistent with what Martin did in r351515, so I have that much going for me. I'm planning on committing the fix shortly. Travis