aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Timber <mieabby@gmail.com>2020-09-04 12:24:19 +0930
committerDavid Timber <mieabby@gmail.com>2020-09-04 12:24:19 +0930
commit68bab4b86fef25f835c6b20a178c9b34ff8d2bd7 (patch)
treeb0818b0790734267bde2c87f4b12791311f738d6
parent3a43c5e6e2afbd0bbcd38d223ce3b41dbe2f5a9f (diff)
Don't initialise static variables to zero.
-rw-r--r--src/dvault.c10
-rw-r--r--src/proone.c8
-rw-r--r--src/resolv.c2
3 files changed, 10 insertions, 10 deletions
diff --git a/src/dvault.c b/src/dvault.c
index 9fbf57f..6a879e5 100644
--- a/src/dvault.c
+++ b/src/dvault.c
@@ -6,11 +6,11 @@
#include <string.h>
-static uint8_t *m_data = NULL;
-static const uint8_t *m_mask = NULL;
-static uint16_t *m_offsets = NULL;
-static uint8_t *m_unmasked = NULL;
-static size_t m_unmasked_size = 0;
+static uint8_t *m_data;
+static const uint8_t *m_mask;
+static uint16_t *m_offsets;
+static uint8_t *m_unmasked;
+static size_t m_unmasked_size;
static uint8_t m_salt;
diff --git a/src/proone.c b/src/proone.c
index 29691fa..35505f5 100644
--- a/src/proone.c
+++ b/src/proone.c
@@ -33,7 +33,7 @@ struct prne_shared_global *prne_s_g = NULL;
sigset_t ss_exit, ss_all;
static prne_worker_t wkr_arr[2];
-static size_t wkr_cnt = 0;
+static size_t wkr_cnt;
static void alloc_resolv (void) {
@@ -705,7 +705,7 @@ static void run_ny_bin (void) {
int main (const int argc, const char **args) {
- static int exit_code = 0;
+ static int exit_code;
static bool loop = true;
sigemptyset(&ss_exit);
@@ -774,8 +774,8 @@ int main (const int argc, const char **args) {
if (prne_g.child_pid > 0) {
static int status;
- static bool has_ny_bin = false;
- static int caught_signal = 0;
+ static bool has_ny_bin;
+ static int caught_signal;
prne_dbgpf("* Child: %d\n", prne_g.child_pid);
diff --git a/src/resolv.c b/src/resolv.c
index 6fab7a4..1fb04fa 100644
--- a/src/resolv.c
+++ b/src/resolv.c
@@ -357,7 +357,7 @@ static void resolv_close_sck (prne_resolv_t *ctx, const struct timespec *pause,
}
static bool resolv_ensure_act_dns_fd (prne_resolv_t *ctx) {
- static socklen_t optval_len = sizeof(int);
+ socklen_t optval_len = sizeof(int);
size_t i;
struct pollfd pfs[2];
int optval, pollret;