Remove %zu format string from ssl_client2 and ssl_server2
diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c
index 9a75c7f..5032a9f 100644
--- a/programs/ssl/ssl_client2.c
+++ b/programs/ssl/ssl_client2.c
@@ -286,6 +286,9 @@
" force_ciphersuite=<name> default: all enabled\n"\
" acceptable ciphersuite names:\n"
+#define ALPN_LIST_SIZE 10
+#define CURVE_LIST_SIZE 20
+
/*
* global options
*/
@@ -440,10 +443,10 @@
size_t psk_len = 0;
#endif
#if defined(MBEDTLS_SSL_ALPN)
- const char *alpn_list[10];
+ const char *alpn_list[ALPN_LIST_SIZE];
#endif
#if defined(MBEDTLS_ECP_C)
- mbedtls_ecp_group_id curve_list[20];
+ mbedtls_ecp_group_id curve_list[CURVE_LIST_SIZE];
const mbedtls_ecp_curve_info *curve_cur;
#endif
@@ -972,8 +975,7 @@
else if( strcmp( p, "default" ) != 0 )
{
/* Leave room for a final NULL in curve list */
- while( i < (int) ( sizeof( curve_list ) / sizeof( *curve_list ) ) - 1
- && *p != '\0' )
+ while( i < CURVE_LIST_SIZE - 1 && *p != '\0' )
{
q = p;
@@ -1004,11 +1006,10 @@
mbedtls_printf("Number of curves: %d\n", i );
- if( i == (int) ( sizeof( curve_list ) / sizeof( *curve_list ) ) - 1
- && *p != '\0' )
+ if( i == CURVE_LIST_SIZE - 1 && *p != '\0' )
{
- mbedtls_printf( "curves list too long, maximum %zu",
- (size_t) ( sizeof( curve_list ) / sizeof( *curve_list ) - 1 ) );
+ mbedtls_printf( "curves list too long, maximum %d",
+ CURVE_LIST_SIZE - 1 );
goto exit;
}
@@ -1024,7 +1025,7 @@
i = 0;
/* Leave room for a final NULL in alpn_list */
- while( i < (int) sizeof alpn_list - 1 && *p != '\0' )
+ while( i < ALPN_LIST_SIZE - 1 && *p != '\0' )
{
alpn_list[i++] = p;