From db1b4d96bfe7e744a0dec8f86cb041c32fb87964 Mon Sep 17 00:00:00 2001 From: Steffan Karger Date: Thu, 16 Mar 2017 10:12:17 +0100 Subject: [PATCH] Fix non-C99-compliant builds: don't use const size_t as array length Signed-off-by: Steffan Karger Acked-by: Gert Doering Message-Id: <1489655537-19164-1-git-send-email-steffan@karger.me> URL: http://www.mail-archive.com/search?l=mid&q=1489655537-19164-1-git-send-email-steffan@karger.me Signed-off-by: Gert Doering --- src/openvpn/crypto_openssl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/openvpn/crypto_openssl.c b/src/openvpn/crypto_openssl.c index 5549d7083..881a2d134 100644 --- a/src/openvpn/crypto_openssl.c +++ b/src/openvpn/crypto_openssl.c @@ -286,8 +286,7 @@ show_available_ciphers() size_t i; /* If we ever exceed this, we must be more selective */ - const size_t cipher_list_len = 1000; - const EVP_CIPHER *cipher_list[cipher_list_len]; + const EVP_CIPHER *cipher_list[1000]; size_t num_ciphers = 0; #ifndef ENABLE_SMALL printf("The following ciphers and cipher modes are available for use\n" @@ -312,7 +311,7 @@ show_available_ciphers() { cipher_list[num_ciphers++] = cipher; } - if (num_ciphers == cipher_list_len) + if (num_ciphers == (sizeof(cipher_list)/sizeof(*cipher_list))) { msg(M_WARN, "WARNING: Too many ciphers, not showing all"); break; -- 2.47.2