X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fstdio%2Fvfprintf.c;h=82ba8719afd2507cd41779dfdb78e012e0129d6d;hp=8c8c0224974dd05555fb8255726279b8db37904f;hb=393020b6e48719d27699dea6b29e53025bbd5123;hpb=f408c1fd633015089d2a0fc6bc31c9f61eeae0a9 diff --git a/functions/stdio/vfprintf.c b/functions/stdio/vfprintf.c index 8c8c022..82ba871 100644 --- a/functions/stdio/vfprintf.c +++ b/functions/stdio/vfprintf.c @@ -16,7 +16,17 @@ int vfprintf( struct _PDCLIB_file_t * _PDCLIB_restrict stream, const char * _PDC { /* TODO: This function should interpret format as multibyte characters. */ /* Members: base, flags, n, i, this, s, width, prec, stream, arg */ - struct _PDCLIB_status_t status = { 0, 0, SIZE_MAX, 0, 0, NULL, 0, 0, stream, arg }; + struct _PDCLIB_status_t status; + status.base = 0; + status.flags = 0; + status.n = SIZE_MAX; + status.i = 0; + status.this = 0; + status.s = NULL; + status.width = 0; + status.prec = 0; + status.stream = stream; + va_copy( status.arg, arg ); while ( *format != '\0' ) { const char * rc; @@ -32,6 +42,7 @@ int vfprintf( struct _PDCLIB_file_t * _PDCLIB_restrict stream, const char * _PDC format = rc; } } + va_end( status.arg ); return status.i; }