From: Steffan Karger Date: Thu, 16 Mar 2017 09:12:17 +0000 (+0100) Subject: Fix non-C99-compliant builds: don't use const size_t as array length X-Git-Tag: v2.4.1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce40258ddd0170df60633baab2c3d17f2c104671;p=thirdparty%2Fopenvpn.git 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 (cherry picked from commit db1b4d96bfe7e744a0dec8f86cb041c32fb87964) --- 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;