1 /* vsnprintf( char *, size_t, const char *, va_list )
3 This file is part of the Public Domain C Library (PDCLib).
4 Permission is granted to use, modify, and / or redistribute at will.
12 int vsnprintf( char * _PDCLIB_restrict s, size_t n, const char * _PDCLIB_restrict format, _PDCLIB_va_list arg )
14 /* TODO: This function should interpret format as multibyte characters. */
15 struct _PDCLIB_status_t status;
25 va_copy( status.arg, arg );
27 while ( *format != '\0' )
30 if ( ( *format != '%' ) || ( ( rc = _PDCLIB_print( format, &status ) ) == format ) )
32 /* No conversion specifier, print verbatim */
35 s[ status.i ] = *format;
42 /* Continue parsing after conversion specifier */
57 #define _PDCLIB_FILEID "stdio/vsnprintf.c"
58 #define _PDCLIB_STRINGIO
61 #include "_PDCLIB_test.h"
63 static int testprintf( char * s, const char * format, ... )
67 va_start( arg, format );
68 i = vsnprintf( s, 100, format, arg );
76 #include "printf_testcases.h"