Re: *printf and zero size

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: *printf and zero size
Дата
Msg-id 2524.1133816758@sss.pgh.pa.us
обсуждение исходный текст
Ответ на *printf and zero size  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: *printf and zero size  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.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 unspecifiedvalue less than 1 is returned. 

and that's what our code implements.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: *printf and zero size
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: *printf and zero size