]> pd.if.org Git - pdclib/blobdiff - functions/stdio/printf.c
Yet closer to functional output.
[pdclib] / functions / stdio / printf.c
index 7088e9322bb0e082b081adbd0fc201f89f895b2c..c3c46cf2c344868114c7bc3f624261a9d4c2c19a 100644 (file)
 
 int printf( const char * _PDCLIB_restrict format, ... )
 {
+    int rc;
     va_list ap;
     va_start( ap, format );
-    return vfprintf( stdout, format, ap );
+    rc = vfprintf( stdout, format, ap );
+    va_end( ap );
+    return rc;
 }
 
 #endif
@@ -25,7 +28,7 @@ int printf( const char * _PDCLIB_restrict format, ... )
 
 int main( void )
 {
-    TESTCASE( NO_TESTDRIVER );
+    TESTCASE( printf( "SUCCESS testing printf().\n" ) == 26 );
     return TEST_RESULTS;
 }