Date: Tue, 8 May 2001 10:47:31 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: "Mark E." cc: djgpp-workers AT delorie DOT com Subject: Re: snprintf? In-Reply-To: <3AF7358B.19349.38937B@localhost> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 7 May 2001, Mark E. wrote: > The last snprintf diff is at: > http://www.delorie.com/djgpp/mail-archives/browse.cgi?p=djgpp-workers/2000/11/18/19:19:56 > > it sounds like it takes care of most of the objections raised: > > > * Correct texinfo, as directed by Eli. > > > > * Extended tests, as suggested by Eli. I'm not sure how to induce a > > encoding error in printf() though. Formats like '%!' result in '!' as > > output. I've renamed the test t-snprtf.c from snprintf.c, for debugging > > with gdb. > > > > * snprintf() is now just a wrapper for vsnprintf(). > > > > * n == 0 handled properly now. The buffer pointer in FILE is set to NULL > > in this case, to catch bogus buffer accesses. This last issue is what bothered me. It seemed to me that the code didn't cope well with this (setting a pointer to NULL is looking for SIGSEGV's ;-), and IIRC the test harness didn't test all of the possible cases (I forget the details). The case of n == 0 is very important for snprintf, so it must be rock-solid.