]> pd.if.org Git - pdclib/blob - functions/stdio/vsprintf.c
PDCLib includes with quotes, not <>.
[pdclib] / functions / stdio / vsprintf.c
1 /* vsprintf( char *, const char *, va_list )
2
3    This file is part of the Public Domain C Library (PDCLib).
4    Permission is granted to use, modify, and / or redistribute at will.
5 */
6
7 #include <stdio.h>
8 #include <stdint.h>
9 #include <stdarg.h>
10
11 #ifndef REGTEST
12
13 int vsprintf( char * _PDCLIB_restrict s, 
14               const char * _PDCLIB_restrict format, 
15               va_list arg )
16 {
17     return vsnprintf( s, SIZE_MAX, format, arg ); /* TODO: Replace with a non-checking call */
18 }
19
20 #endif
21
22 #ifdef TEST
23 #define _PDCLIB_FILEID "stdio/vsprintf.c"
24 #define _PDCLIB_STRINGIO
25 #include <stdint.h>
26 #include <stddef.h>
27 #include "_PDCLIB_test.h"
28
29 static int testprintf( char * s, const char * format, ... )
30 {
31     int i;
32     va_list arg;
33     va_start( arg, format );
34     i = vsprintf( s, format, arg );
35     va_end( arg );
36     return i;
37 }
38
39 int main( void )
40 {
41     char target[100];
42 #include "printf_testcases.h"
43     return TEST_RESULTS;
44 }
45
46 #endif