From 0e17cc93c67b6c591e61ae6f6ec740e44c6a26c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 11 Dec 2018 09:26:54 +0100 Subject: [PATCH] Avoid stringifying condition too early It's better if the macro receives the condition as an expression rather than a string - that way it can choose to use it as is or stringify it. Also, the documentation states that the parameter is an expression, not a string. --- include/mbedtls/platform_util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/mbedtls/platform_util.h b/include/mbedtls/platform_util.h index 1ac16d45f..105b43caf 100644 --- a/include/mbedtls/platform_util.h +++ b/include/mbedtls/platform_util.h @@ -87,7 +87,7 @@ void mbedtls_param_failed( const char *failure_condition, do { \ if( !(cond) ) \ { \ - MBEDTLS_PARAM_FAILED( #cond ); \ + MBEDTLS_PARAM_FAILED( cond ); \ return( ret ); \ } \ } while( 0 ) @@ -97,7 +97,7 @@ void mbedtls_param_failed( const char *failure_condition, do { \ if( !(cond) ) \ { \ - MBEDTLS_PARAM_FAILED( #cond ); \ + MBEDTLS_PARAM_FAILED( cond ); \ return; \ } \ } while( 0 )