summaryrefslogtreecommitdiffstats
path: root/server/inputs_channel.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-03-09 12:49:26 +0100
committerHans de Goede <hdegoede@redhat.com>2012-03-10 11:51:54 +0100
commitf24203e122c756e3b3ee540c718409451e4f9458 (patch)
tree0d30f319bea9cd6d811fbf1fdb875968cb0d4ef0 /server/inputs_channel.c
parent1029e7fd4d2ba837d5b14a4b8d93b6a9c4ab75ac (diff)
downloadspice-f24203e122c756e3b3ee540c718409451e4f9458.tar.gz
spice-f24203e122c756e3b3ee540c718409451e4f9458.tar.xz
spice-f24203e122c756e3b3ee540c718409451e4f9458.zip
Ensure all members of ChannelCbs and ClientCbs are either assigned or NULL
While git-bisecting another issue I ended up hitting and not recognizing the bug fixed by commit 7a079b452b026d6ce38f95dcc397fa64b059fffb. While fixing this (again) I noticed that (even after the fix) not all users of ChannelCbs first zero it. So this patch ensures that all users of ChannelCbs first zero it, and does the same for ClientCbs while at it. Since before this patch there were multiple zero-ing styles, some using memset and other using a zero initializer this patch also unifies all the zero-ing to use a NULL initializer for the first element. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'server/inputs_channel.c')
-rw-r--r--server/inputs_channel.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/server/inputs_channel.c b/server/inputs_channel.c
index a3f26c02..932ead72 100644
--- a/server/inputs_channel.c
+++ b/server/inputs_channel.c
@@ -525,14 +525,11 @@ static void key_modifiers_sender(void *opaque)
void inputs_init(void)
{
- ChannelCbs channel_cbs;
- ClientCbs client_cbs;
+ ChannelCbs channel_cbs = { NULL, };
+ ClientCbs client_cbs = { NULL, };
ASSERT(!g_inputs_channel);
- memset(&channel_cbs, 0, sizeof(channel_cbs));
- memset(&client_cbs, 0, sizeof(client_cbs));
-
channel_cbs.config_socket = inputs_channel_config_socket;
channel_cbs.on_disconnect = inputs_channel_on_disconnect;
channel_cbs.send_item = inputs_channel_send_item;