From f041f4e19cf53522ce25256438384b9cbd0f2dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 24 Jul 2019 00:58:27 +0200 Subject: [PATCH] Fix MSVC warning We know the length of the ALPN string is always less than 255, so the cast to uint8_t is safe. --- library/ssl_tls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index b0454ceb8..3971fd7a6 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -11553,7 +11553,7 @@ int mbedtls_ssl_context_save( mbedtls_ssl_context *ssl, #if defined(MBEDTLS_SSL_ALPN) { const uint8_t alpn_len = ssl->alpn_chosen - ? strlen( ssl->alpn_chosen ) + ? (uint8_t) strlen( ssl->alpn_chosen ) : 0; used += 1 + alpn_len;