]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix non-C99-compliant builds: don't use const size_t as array length
authorSteffan Karger <steffan@karger.me>
Thu, 16 Mar 2017 09:12:17 +0000 (10:12 +0100)
committerGert Doering <gert@greenie.muc.de>
Thu, 16 Mar 2017 09:37:21 +0000 (10:37 +0100)
Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
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 <gert@greenie.muc.de>
src/openvpn/crypto_openssl.c

index 5549d708345c3b729bd6705f4f873d9891b93eb4..881a2d1342bac3b51ad9d5d5fdb54fd45f513986 100644 (file)
@@ -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;