@@ -307,12 +307,11 @@ int ZEXPORT gzputs(file, str)
307307#include <stdarg.h>
308308
309309/* -- see zlib.h -- */
310- int ZEXPORTVA gzprintf (gzFile file , const char * format , ... )
310+ int ZEXPORTVA gzvprintf (gzFile file , const char * format , va_list va )
311311{
312312 int size , len ;
313313 gz_statep state ;
314314 z_streamp strm ;
315- va_list va ;
316315
317316 /* get internal structure */
318317 if (file == NULL )
@@ -342,25 +341,20 @@ int ZEXPORTVA gzprintf (gzFile file, const char *format, ...)
342341 /* do the printf() into the input buffer, put length in len */
343342 size = (int )(state -> size );
344343 state -> in [size - 1 ] = 0 ;
345- va_start (va , format );
346344#ifdef NO_vsnprintf
347345# ifdef HAS_vsprintf_void
348346 (void )vsprintf ((char * )(state -> in ), format , va );
349- va_end (va );
350347 for (len = 0 ; len < size ; len ++ )
351348 if (state -> in [len ] == 0 ) break ;
352349# else
353350 len = vsprintf ((char * )(state -> in ), format , va );
354- va_end (va );
355351# endif
356352#else
357353# ifdef HAS_vsnprintf_void
358354 (void )vsnprintf ((char * )(state -> in ), size , format , va );
359- va_end (va );
360355 len = strlen ((char * )(state -> in ));
361356# else
362357 len = vsnprintf ((char * )(state -> in ), size , format , va );
363- va_end (va );
364358# endif
365359#endif
366360
@@ -375,6 +369,17 @@ int ZEXPORTVA gzprintf (gzFile file, const char *format, ...)
375369 return len ;
376370}
377371
372+ int ZEXPORTVA gzprintf (gzFile file , const char * format , ...)
373+ {
374+ va_list va ;
375+ int ret ;
376+
377+ va_start (va , format );
378+ ret = gzvprintf (file , format , va );
379+ va_end (va );
380+ return ret ;
381+ }
382+
378383#else /* !STDC && !Z_HAVE_STDARG_H */
379384
380385/* -- see zlib.h -- */
0 commit comments