]> granicus.if.org Git - postgresql/blob - src/backend/utils/error/format.c
Further work on elog cleanup: fix some bogosities in elog's logic about
[postgresql] / src / backend / utils / error / format.c
1 /*-------------------------------------------------------------------------
2  *
3  * format.c
4  *        a wrapper around code that does what vsprintf does.
5  *
6  * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  *
10  * IDENTIFICATION
11  *        $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/format.c,v 1.16 2001/01/24 19:43:15 momjian Exp $
12  *
13  *-------------------------------------------------------------------------
14  */
15 #include "postgres.h"
16
17 #define FormMaxSize             1024
18 #define FormMinSize             (FormMaxSize / 8)
19
20 static char FormBuf[FormMaxSize];
21
22
23 /* ----------------
24  *              vararg_format
25  * ----------------
26  */
27 char *
28 vararg_format(const char *fmt,...)
29 {
30         va_list         args;
31
32         va_start(args, fmt);
33         vsnprintf(FormBuf, FormMaxSize - 1, fmt, args);
34         va_end(args);
35         return FormBuf;
36 }