From dff720b49b581d1937cc0aab8256f9eb8cce207e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Janouch?= Date: Tue, 28 Apr 2015 18:16:31 +0200 Subject: [PATCH] kike: no more shooting ourselves in the foot Just zero out the whole structure. --- kike.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/kike.c b/kike.c index bd3c3fb..8505f1b 100644 --- a/kike.c +++ b/kike.c @@ -557,11 +557,7 @@ on_irc_quit_timeout (void *user_data) static void server_context_init (struct server_context *self) { - self->listen_fds = NULL; - self->listen_events = NULL; - self->n_listen_fds = 0; - self->clients = NULL; - self->n_clients = 0; + memset (self, 0, sizeof *self); str_map_init (&self->users); self->users.key_xfrm = irc_strxfrm; @@ -572,21 +568,14 @@ server_context_init (struct server_context *self) self->handlers.key_xfrm = irc_strxfrm; poller_init (&self->poller); - self->quitting = false; - self->polling = false; poller_timer_init (&self->quit_timer, &self->poller); self->quit_timer.dispatcher = on_irc_quit_timeout; self->quit_timer.user_data = self; - memset (&self->signal_event, 0, sizeof self->signal_event); - str_map_init (&self->config); self->config.free = free; load_config_defaults (&self->config, g_config_table); - self->server_name = NULL; - self->ping_interval = 0; - self->max_connections = 0; str_vector_init (&self->motd); self->catalog = (nl_catd) -1; str_map_init (&self->operators);