3 /* vsnprintf( char *, size_t, const char *, va_list ap )
5 This file is part of the Public Domain C Library (PDCLib).
6 Permission is granted to use, modify, and / or redistribute at will.
14 int vsnprintf( char * _PDCLIB_restrict s, size_t n, const char * _PDCLIB_restrict format, _PDCLIB_va_list arg )
16 /* TODO: This function should interpret format as multibyte characters. */
17 struct _PDCLIB_status_t status;
27 va_copy( status.arg, arg );
29 while ( *format != '\0' )
32 if ( ( *format != '%' ) || ( ( rc = _PDCLIB_print( format, &status ) ) == format ) )
34 /* No conversion specifier, print verbatim */
35 s[ status.i++ ] = *(format++);
39 /* Continue parsing after conversion specifier */
51 #include <_PDCLIB_test.h>
58 static int testprintf( char * s, size_t n, const char * format, ... )
62 va_start( arg, format );
63 i = vsnprintf( s, n, format, arg );
71 #include "printf_testcases.incl"