]> pd.if.org Git - pdclib/blobdiff - functions/stdio/vfprintf.c
Merged branch stdio_rewrite back into trunk.
[pdclib] / functions / stdio / vfprintf.c
index 8c8c0224974dd05555fb8255726279b8db37904f..82ba8719afd2507cd41779dfdb78e012e0129d6d 100644 (file)
@@ -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;
 }