From: Marcus Brinkmann Date: Fri, 2 Nov 2001 15:23:40 +0000 (+0000) Subject: 2001-11-01 Marcus Brinkmann X-Git-Tag: gpgme-1.2.0@1385~1288 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d70c632026961da185cb579b54f3493163c7402c;p=gpgme.git 2001-11-01 Marcus Brinkmann * logging.c (log_printf): Do not initialize ARG_PTR with 0, we don't know the correct type. Instead, run va_start and va_end unconditionally. Reported by Jose Carlos Garcia Sogo . --- diff --git a/trunk/jnlib/ChangeLog b/trunk/jnlib/ChangeLog index 92ce65a..1d750bf 100644 --- a/trunk/jnlib/ChangeLog +++ b/trunk/jnlib/ChangeLog @@ -1,3 +1,10 @@ +2001-11-01 Marcus Brinkmann + + * logging.c (log_printf): Do not initialize ARG_PTR with 0, we + don't know the correct type. Instead, run va_start and va_end + unconditionally. + Reported by Jose Carlos Garcia Sogo . + 2001-08-30 Werner Koch * logging.c (log_printf): Don't pass NULL instead of arg_ptr. diff --git a/trunk/jnlib/logging.c b/trunk/jnlib/logging.c index dc439ff..69b94b1 100644 --- a/trunk/jnlib/logging.c +++ b/trunk/jnlib/logging.c @@ -222,18 +222,13 @@ log_debug( const char *fmt, ... ) void -log_printf( const char *fmt, ... ) +log_printf (const char *fmt, ...) { - va_list arg_ptr = 0; + va_list arg_ptr; - if( !fmt ) { - do_logv( MY_LOG_BEGIN, NULL, arg_ptr ); - } - else { - va_start( arg_ptr, fmt ) ; - do_logv( MY_LOG_CONT, fmt, arg_ptr ); - va_end(arg_ptr); - } + va_start (arg_ptr, fmt); + do_logv (fmt ? MY_LOG_CONT : MY_LOG_BEGIN, fmt, arg_ptr); + va_end (arg_ptr); }