postgresql/src/backend/lib
Tom Lane 3147acd63e Use improved vsnprintf calling logic in more places.
When we are using a C99-compliant vsnprintf implementation (which should be
most places, these days) it is worth the trouble to make use of its report
of how large the buffer needs to be to succeed.  This patch adjusts
stringinfo.c and some miscellaneous usages in pg_dump to do that, relying
on the logic recently added in libpgcommon's psprintf.c.  Since these
places want to know the number of bytes written once we succeed, modify the
API of pvsnprintf() to report that.

There remains near-duplicate logic in pqexpbuffer.c, but since that code
is in libpq, psprintf.c's approach of exit()-on-error isn't appropriate
for use there.  Also note that I didn't bother touching the multitude
of places that call (v)snprintf without any attempt to provide a resizable
buffer.

Release-note-worthy incompatibility: the API of appendStringInfoVA()
changed.  If there's any third-party code that's calling that directly,
it will need tweaking along the same lines as in this patch.

David Rowley and Tom Lane
2013-10-24 21:43:57 -04:00
..
Makefile Basic binary heap implementation. 2012-11-29 11:16:59 -05:00
binaryheap.c Reset the binary heap in MergeAppend rescans. 2013-08-30 19:15:21 -04:00
ilist.c Improve ilist.h's support for deletion of slist elements during iteration. 2013-07-24 17:42:34 -04:00
stringinfo.c Use improved vsnprintf calling logic in more places. 2013-10-24 21:43:57 -04:00