mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-23 13:55:29 +00:00
Avoid formatting debug message uselessly
This commit is contained in:
parent
6461f368d8
commit
925a72628b
|
@ -57,7 +57,10 @@
|
|||
|
||||
|
||||
#define SSL_DEBUG_MSG( level, args ) \
|
||||
debug_print_msg_free( ssl, level, __FILE__, __LINE__, debug_fmt args );
|
||||
do { \
|
||||
if( level <= debug_threshold ) \
|
||||
debug_print_msg_free( ssl, level, __FILE__, __LINE__, debug_fmt args ); \
|
||||
} while( 0 )
|
||||
|
||||
#define SSL_DEBUG_RET( level, text, ret ) \
|
||||
debug_print_ret( ssl, level, __FILE__, __LINE__, text, ret );
|
||||
|
@ -147,6 +150,8 @@ void debug_print_crt( const ssl_context *ssl, int level,
|
|||
const char *text, const x509_crt *crt );
|
||||
#endif
|
||||
|
||||
extern int debug_threshold;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
#define DEBUG_BUF_SIZE 512
|
||||
|
||||
static int debug_log_mode = POLARSSL_DEBUG_DFL_MODE;
|
||||
static int debug_threshold = 0;
|
||||
int debug_threshold = 0;
|
||||
|
||||
void debug_set_log_mode( int log_mode )
|
||||
{
|
||||
|
@ -73,7 +73,7 @@ char *debug_fmt( const char *format, ... )
|
|||
char *str = polarssl_malloc( DEBUG_BUF_SIZE );
|
||||
|
||||
if( str == NULL )
|
||||
return;
|
||||
return( NULL );
|
||||
|
||||
va_start( argp, format );
|
||||
vsnprintf( str, DEBUG_BUF_SIZE - 1, format, argp );
|
||||
|
|
Loading…
Reference in a new issue