]> pd.if.org Git - pdclib/blob - functions/stdio/vsprintf.c
Comment cleanups.
[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, const char * _PDCLIB_restrict format, va_list arg )
14 {
15     return vsnprintf( s, SIZE_MAX, format, arg ); /* TODO: Replace with a non-checking call */
16 }
17
18 #endif
19
20 #ifdef TEST
21 #define _PDCLIB_FILEID "stdio/vsprintf.c"
22 #define _PDCLIB_STRINGIO
23
24 #include <_PDCLIB_test.h>
25
26 static int testprintf( char * s, const char * format, ... )
27 {
28     int i;
29     va_list arg;
30     va_start( arg, format );
31     i = vsprintf( s, format, arg );
32     va_end( arg );
33     return i;
34 }
35
36 int main( void )
37 {
38     char target[100];
39 #include "printf_testcases.h"
40     return TEST_RESULTS;
41 }
42
43 #endif