Refactor macro-spanning if in ssl_msg.c
Signed-off-by: David Horstmann <david.horstmann@arm.com>
diff --git a/library/ssl_msg.c b/library/ssl_msg.c
index 7e27570..e8f47de 100644
--- a/library/ssl_msg.c
+++ b/library/ssl_msg.c
@@ -3944,8 +3944,8 @@
if( ssl_record_is_in_progress( ssl ) == 0 )
{
+ int dtls_have_buffered = 0;
#if defined(MBEDTLS_SSL_PROTO_DTLS)
- int have_buffered = 0;
/* We only check for buffered messages if the
* current datagram is fully consumed. */
@@ -3953,11 +3953,11 @@
ssl_next_record_is_in_datagram( ssl ) == 0 )
{
if( ssl_load_buffered_message( ssl ) == 0 )
- have_buffered = 1;
+ dtls_have_buffered = 1;
}
- if( have_buffered == 0 )
#endif /* MBEDTLS_SSL_PROTO_DTLS */
+ if( dtls_have_buffered == 0 )
{
ret = ssl_get_next_record( ssl );
if( ret == MBEDTLS_ERR_SSL_CONTINUE_PROCESSING )