X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Fprintf.c;h=c3c46cf2c344868114c7bc3f624261a9d4c2c19a;hb=eb9211f1090ef05e8490a6b35acbe16c9ed9f89a;hp=4933422cd6548f09369bbfbc37ccdc56d55c6140;hpb=12e17136786afb1775c9dc946cbe41f5e230c24a;p=pdclib.old diff --git a/functions/stdio/printf.c b/functions/stdio/printf.c index 4933422..c3c46cf 100644 --- a/functions/stdio/printf.c +++ b/functions/stdio/printf.c @@ -1,7 +1,5 @@ /* $Id$ */ -/* Release $Name$ */ - /* printf( const char *, ... ) This file is part of the Public Domain C Library (PDCLib). @@ -15,9 +13,12 @@ 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 @@ -27,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; }