diff options
author | Hans de Goede <hdegoede@redhat.com> | 2012-03-09 12:49:26 +0100 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2012-03-10 11:51:54 +0100 |
commit | f24203e122c756e3b3ee540c718409451e4f9458 (patch) | |
tree | 0d30f319bea9cd6d811fbf1fdb875968cb0d4ef0 /server/smartcard.c | |
parent | 1029e7fd4d2ba837d5b14a4b8d93b6a9c4ab75ac (diff) | |
download | spice-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/smartcard.c')
-rw-r--r-- | server/smartcard.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/server/smartcard.c b/server/smartcard.c index facc4b37..84aa18b3 100644 --- a/server/smartcard.c +++ b/server/smartcard.c @@ -512,14 +512,11 @@ SmartCardChannel *g_smartcard_channel; static void smartcard_init(void) { - ChannelCbs channel_cbs; - ClientCbs client_cbs; + ChannelCbs channel_cbs = { NULL, }; + ClientCbs client_cbs = { NULL, }; ASSERT(!g_smartcard_channel); - memset(&channel_cbs, 0, sizeof(channel_cbs)); - memset(&client_cbs, 0, sizeof(client_cbs)); - channel_cbs.config_socket = smartcard_channel_client_config_socket; channel_cbs.on_disconnect = smartcard_channel_on_disconnect; channel_cbs.send_item = smartcard_channel_send_item; |