1 //
2 // aegis - project change supervisor
3 // Copyright (C) 2002, 2004-2008 Peter Miller
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see
17 // <http://www.gnu.org/licenses/>.
18 //
19
20 #include <common/ac/stdarg.h>
21 #include <common/ac/stdio.h>
22
23
24 #ifndef HAVE_SNPRINTF
25
26 int
snprintf(char * buffer,size_t nbytes,const char * fmt,...)27 snprintf(char *buffer, size_t nbytes, const char *fmt, ...)
28 {
29 va_list ap;
30
31 va_start(ap, fmt);
32 vsnprintf(buffer, nbytes, fmt, ap);
33 va_end(ap);
34 }
35
36 #endif
37
38
39 #ifndef HAVE_VSNPRINTF
40
41 int
vsnprintf(char * buffer,size_t,const char * fmt,...)42 vsnprintf(char *buffer, size_t, const char *fmt, ...)
43 {
44 vsprintf(buffer, fmt, ap);
45 }
46
47 #endif
48