Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: *printf and zero size


  • From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
  • To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
  • Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
  • Subject: Re: *printf and zero size
  • Date: Mon, 05 Dec 2005 16:05:58 -0500
  • Message-id: <2524(dot)1133816758(at)sss(dot)pgh(dot)pa(dot)us>

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Tom, did you implement this functionality in *printf?
> 	The size may be given as zero to find out how many characters are
> 	needed; in this case, the str argument is ignored. Sprintf() and
> 	vsprintf() effectively assume an infinite size.

Where do you read that?  The SUS says the opposite:

	If the value of n is zero on a call to snprintf(), an unspecified
	value less than 1 is returned. 

and that's what our code implements.

			regards, tom lane



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group