Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com From: Chris Faylor Date: Mon, 3 May 1999 22:26:25 -0400 To: Mumit Khan Cc: Corinna Vinschen , cygwin-developers AT sourceware DOT cygnus DOT com Subject: Re: (fixed patch) "%E" formatting for the humans Message-ID: <19990503222625.A2251@cygnus.com> References: <372E2625 DOT 791A1EA AT cityweb DOT de> <199905040206 DOT VAA25326 AT modi DOT xraylith DOT wisc DOT edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.3i In-Reply-To: <199905040206.VAA25326@modi.xraylith.wisc.edu>; from Mumit Khan on Mon, May 03, 1999 at 09:06:48PM -0500 On Mon, May 03, 1999 at 09:06:48PM -0500, Mumit Khan wrote: >Corinna Vinschen writes: >> >> FormatMessage has an option, to allocate the needed buffer itself >> (FORMAT_MESSAGE_ALLOCATE_BUFFER or similar). This buffer should >> then be freed with LocalFree() after usage. >> Would this be an alternative? > >That was what I had done at first, only to discover that it doesn't fit >into the model used by small_vsprintf etc al very well (passed in pre >allocated buffer, arbitrary number of formatting directives, etc make >it impossible to inject a newly allocated buffer within). I'd welcome >any suggestions of course. The small_vsprintf model is the vsprintf model. In the case of %E, I believe that this is only actually used by strace and api_fatal. strace_printf has a 10,000 byte buffer, api_fatal uses a 4096 byte buffer. I would welcome a patch if someone wants to modify cygwin to use the vnsprintf model instead. cgf