Browse code

Silence warning about format string in check_ca_required

clang does not like if the format argument of printf like function
is not a string literal (or constant):

warning: format string is not a string literal (potentially insecure)

Make the format string constant to silence the warning.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Selva Nair <selva.nair@gmail.com>
Message-Id: <20210609061532.12774-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22519.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>

Arne Schwabe authored on 2021/06/09 15:15:32
Showing 1 changed files
... ...
@@ -2069,7 +2069,7 @@ check_ca_required(const struct options *options)
2069 2069
         return;
2070 2070
     }
2071 2071
 
2072
-    const char* str = "You must define CA file (--ca)"
2072
+    const char* const str = "You must define CA file (--ca)"
2073 2073
 #ifndef ENABLE_CRYPTO_MBEDTLS
2074 2074
         " or CA path (--capath)"
2075 2075
 #endif