]> pd.if.org Git - pdclib/blobdiff - functions/stdio/vsprintf.c
*Much* better.
[pdclib] / functions / stdio / vsprintf.c
index 5276e3920a6278b406d32aa3d3c89faa1fcea027..7515a6fc49aa0b7afd262c35c2d6b7345a514f87 100644 (file)
 
 #ifndef REGTEST
 
-int foo = SIZE_MAX;
-
-int vsprintf( char * str, const char * format, va_list arg )
+int vsprintf( char * _PDCLIB_restrict s, const char * _PDCLIB_restrict format, va_list arg )
 {
-    return vsnprintf( str, SIZE_MAX, format, arg ); /* TODO: Replace with a non-checking call */
+    return vsnprintf( s, SIZE_MAX, format, arg ); /* TODO: Replace with a non-checking call */
 }
 
 #endif
 
 #ifdef TEST
+#define _PDCLIB_FILEID "stdio/vsprintf.c"
+#define SPRINTF_FUNCTION
 #include <_PDCLIB_test.h>
 
+#include <limits.h>
+#include <stdint.h>
+#include <string.h>
+
+static int testprintf( char * s, const char * format, ... )
+{
+    int i;
+    va_list arg;
+    va_start( arg, format );
+    i = vsprintf( s, format, arg );
+    va_end( arg );
+    return i;
+}
+
 int main( void )
 {
-    TESTCASE( NO_TESTDRIVER );
+    char target[100];
+#include "printf_testcases.incl"
     return TEST_RESULTS;
 }