From: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com> Date: Sat, 17 Jul 2021 10:00:05 +0000 (+0200) Subject: Fix Linux kernel coding style error X-Git-Tag: v8.20~80^2~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0621ef940d28a95e3aa9054e0c02f6c7ab1153d3;p=users%2Fdwmw2%2Fopenconnect.git Fix Linux kernel coding style error do not initialise statics to 0 do not initialise statics to NULL Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com> --- diff --git a/main.c b/main.c index c6908eb9..2d91f2aa 100644 --- 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) { diff --git a/openssl-dtls.c b/openssl-dtls.c index 1d17bfed..7dd9c4cb 100644 --- a/openssl-dtls.c +++ b/openssl-dtls.c @@ -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 07099bed..650278fc 100644 --- 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,