Date: Sun, 13 Jun 1999 11:12:08 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Alain Magloire cc: djgpp-workers AT delorie DOT com Subject: Re: {v,}snprintf.c ??? In-Reply-To: <199906092004.QAA18356@mccoy2.ECE.McGill.CA> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 9 Jun 1999, Alain Magloire wrote: > int > snprintf(char *str, size_t n, const char *fmt, ...) > { > FILE _strbuf; > int len; > > if ((int)n < 1) > return EOF; The C9X draft is rather vague on this point, but it surely doesn't say that N should be strictly positive. In fact, I can understand its language as meaning that calling {v,}snprintf with a zero N is a way to know how many characters should I allocate for the string that I pass to it when I *really* need some output. What do other implementations do when N is zero?