]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Fix Linux kernel coding style error
authorDimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
Sat, 17 Jul 2021 10:00:05 +0000 (12:00 +0200)
committerDimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
Mon, 19 Jul 2021 11:47:43 +0000 (13:47 +0200)
do not initialise statics to 0
do not initialise statics to NULL

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
main.c
openssl-dtls.c
tun.c

diff --git a/main.c b/main.c
index c6908eb97ddde8d739288ece55e7e9ee662325b3..2d91f2aa5cdabdd5a563986e41f461b9272f5a4d 100644 (file)
--- a/main.c
+++ b/main.c
@@ -85,9 +85,9 @@ static int verbose = PRG_INFO;
 static int timestamp;
 #ifndef _WIN32
 static int background;
-static int use_syslog = 0;
-int wrote_pid = 0;
-static char *pidfile = NULL;
+static int use_syslog; /* static variable initialised to 0 */
+static int wrote_pid; /* static variable initialised to 0 */
+static char *pidfile; /* static variable initialised to NULL */
 #endif
 static int do_passphrase_from_fsid;
 static int non_inter;
@@ -971,8 +971,8 @@ static void usage(void)
 }
 
 
-static FILE *config_file = NULL;
-static int config_line_num = 0;
+static FILE *config_file; /* static variable initialised to NULL */
+static int config_line_num;  /* static variable initialised to 0 */
 
 static char *xstrdup(const char *arg)
 {
@@ -1027,8 +1027,8 @@ static inline char *__dup_config_arg(char **argv, char *config_arg)
 static int next_option(int argc, char **argv, char **config_arg)
 {
        /* These get re-used */
-       static char *line_buf = NULL;
-       static size_t line_size = 0;
+       static char *line_buf; /* static variable initialised to NULL */
+       static size_t line_size; /* static variable initialised to 0 */
 
        ssize_t llen;
        int opt, optlen = 0;
@@ -2507,7 +2507,7 @@ struct form_field {
        char *opt_id;
        char *value;
 };
-static struct form_field *form_fields = NULL;
+static struct form_field *form_fields; /* static variable initialised to NULL */
 
 static void add_form_field(char *arg)
 {
index 1d17bfed872e70a79122915afe1ec92d536ced29..7dd9c4cb4f7ccf7c63ac91f2ff437ec6b3694bfa 100644 (file)
@@ -771,7 +771,7 @@ int dtls_try_handshake(struct openconnect_info *vpninfo, int *timeout)
                        return 0;
                }
 
-               static int badossl_bitched = 0;
+               static int badossl_bitched; /* static variable initialised to 0 */
                if (((OPENSSL_VERSION_NUMBER >= 0x100000b0L && OPENSSL_VERSION_NUMBER <= 0x100000c0L) ||
                     (OPENSSL_VERSION_NUMBER >= 0x10001040L && OPENSSL_VERSION_NUMBER <= 0x10001060L) ||
                     OPENSSL_VERSION_NUMBER == 0x10002000L) && !badossl_bitched) {
diff --git a/tun.c b/tun.c
index 07099bed6f83910f4429e012bb5785c6d3fc6d43..650278fca0270e1913e017da30a0091d76f8964a 100644 (file)
--- a/tun.c
+++ b/tun.c
@@ -543,7 +543,7 @@ int os_write_tun(struct openconnect_info *vpninfo, struct pkt *pkt)
                else if (iph->ip_v == 4)
                        type = AF_INET;
                else {
-                       static int complained = 0;
+                       static int complained; /* static variable initialised to 0 */
                        if (!complained) {
                                complained = 1;
                                vpn_progress(vpninfo, PRG_ERR,