Re: Reasons not to like asprintf

Поиск
Список
Период
Сортировка
От Florian Weimer
Тема Re: Reasons not to like asprintf
Дата
Msg-id 52677486.90207@redhat.com
обсуждение исходный текст
Ответ на Re: Reasons not to like asprintf  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 10/22/2013 11:06 PM, Tom Lane wrote:

> Attached is a draft, which compiles though I've not yet actually tested it.
nprinted = vsnprintf(buf, len, fmt, args);
Assert(buf[len - 1] == '\0');

The assert may fire if len > INT_MAX and the system returns with errno 
== EOVERFLOW, as required by POSIX.  It's probably better to move it 
after the error logging.

-- 
Florian Weimer / Red Hat Product Security Team



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

Предыдущее
От: Florian Weimer
Дата:
Сообщение: Re: Why the asprintf patch is still breaking the buildfarm
Следующее
От: Samrat Revagade
Дата:
Сообщение: Review of pg_rewind