From 8f00200a9795697a7a432ab93ff059281c6ed87d Mon Sep 17 00:00:00 2001 From: James Haley Date: Sun, 15 Jul 2012 09:35:45 +0000 Subject: Fix problem with uninitialized values in the settings structure which surfaces during debug builds under MSVC. ATTN fraggle: review other games' code for similar problems. Subversion-branch: /branches/v2-branch Subversion-revision: 2515 --- src/hexen/d_net.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hexen/d_net.c b/src/hexen/d_net.c index 9b26af31..0fe5ed1e 100644 --- a/src/hexen/d_net.c +++ b/src/hexen/d_net.c @@ -155,6 +155,11 @@ static void SaveGameSettings(net_gamesettings_t *settings, { int i; + // jhaley 20120715: Some parts of the structure are being left + // uninitialized. If -class is not used on the command line, this + // can lead to a crash in SB_Init due to player class == 0xCCCCCCCC. + memset(settings, 0, sizeof(*settings)); + // Fill in game settings structure with appropriate parameters // for the new game -- cgit v1.2.3