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.
13 #include <_PDCLIB_io.h>
21 static size_t strout( void *p, const char *buf, size_t sz )
24 size_t copy = s->bufrem >= sz ? sz : s->bufrem;
25 memcpy( s->bufp, buf, copy );
31 int vsnprintf( char * _PDCLIB_restrict s,
33 const char * _PDCLIB_restrict format,
39 int r = _vcbprintf( &st, strout, format, arg );
51 #define _PDCLIB_FILEID "stdio/vsnprintf.c"
52 #define _PDCLIB_STRINGIO
55 #include <_PDCLIB_test.h>
57 static int testprintf( char * s, const char * format, ... )
61 va_start( arg, format );
62 i = vsnprintf( s, 100, format, arg );
70 #include "printf_testcases.h"