From f97db614397ed6ae721f4d7458ebb0f499aee185 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 2 Jun 2008 18:23:37 +0000 Subject: [PATCH] Clear msgdata where it is unavailable. --- cfg.c | 3 ++- key-bindings.c | 3 ++- server-msg.c | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cfg.c b/cfg.c index 4b4b2476..480a6b6b 100644 --- a/cfg.c +++ b/cfg.c @@ -1,4 +1,4 @@ -/* $Id: cfg.c,v 1.1 2008-06-02 18:08:16 nicm Exp $ */ +/* $Id: cfg.c,v 1.2 2008-06-02 18:23:37 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -121,6 +121,7 @@ load_cfg(const char *path, char **cause) goto error; } + ctx.msgdata = NULL; ctx.cursession = NULL; ctx.curclient = NULL; diff --git a/key-bindings.c b/key-bindings.c index 96a220f2..8754a7a0 100644 --- a/key-bindings.c +++ b/key-bindings.c @@ -1,4 +1,4 @@ -/* $Id: key-bindings.c,v 1.26 2008-06-02 18:08:16 nicm Exp $ */ +/* $Id: key-bindings.c,v 1.27 2008-06-02 18:23:37 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -188,6 +188,7 @@ key_bindings_dispatch(int key, struct client *c) if (i == ARRAY_LENGTH(&key_bindings)) return; + ctx.msgdata = NULL; ctx.cursession = c->session; ctx.curclient = c; diff --git a/server-msg.c b/server-msg.c index ed8b86b6..d419e9f2 100644 --- a/server-msg.c +++ b/server-msg.c @@ -1,4 +1,4 @@ -/* $Id: server-msg.c,v 1.44 2008-06-02 18:08:17 nicm Exp $ */ +/* $Id: server-msg.c,v 1.45 2008-06-02 18:23:37 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -122,9 +122,9 @@ server_msg_fn_command(struct hdr *hdr, struct client *c) ctx.error = server_msg_fn_command_error; ctx.print = server_msg_fn_command_print; + ctx.msgdata = &data; ctx.curclient = NULL; ctx.cursession = NULL; - ctx.msgdata = &data; ctx.cmdclient = c; ctx.flags = 0;