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.
11 #include "_PDCLIB_io.h"
19 static size_t strout( void *p, const char *buf, size_t sz )
22 size_t copy = s->bufrem >= sz ? sz : s->bufrem;
23 memcpy( s->bufp, buf, copy );
29 int vsnprintf( char * _PDCLIB_restrict s,
31 const char * _PDCLIB_restrict format,
37 int r = _vcbprintf( &st, strout, format, arg );
49 #define _PDCLIB_FILEID "stdio/vsnprintf.c"
50 #define _PDCLIB_STRINGIO
53 #include "_PDCLIB_test.h"
55 static int testprintf( char * s, const char * format, ... )
59 va_start( arg, format );
60 i = vsnprintf( s, 100, format, arg );
68 #include "printf_testcases.h"