postgresql/src/backend/utils/error/format.c

37 lines
865 B
C
Raw Normal View History

/*-------------------------------------------------------------------------
*
* format.c
* a wrapper around code that does what vsprintf does.
*
2002-06-20 16:29:54 -04:00
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
2002-06-20 16:29:54 -04:00
* $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/format.c,v 1.17 2002/06/20 20:29:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#define FormMaxSize 1024
#define FormMinSize (FormMaxSize / 8)
static char FormBuf[FormMaxSize];
/* ----------------
1999-06-19 01:00:30 -04:00
* vararg_format
* ----------------
*/
char *
1999-06-19 01:00:30 -04:00
vararg_format(const char *fmt,...)
{
va_list args;
1999-05-25 12:15:34 -04:00
va_start(args, fmt);
vsnprintf(FormBuf, FormMaxSize - 1, fmt, args);
va_end(args);
1998-08-31 23:29:17 -04:00
return FormBuf;
}