From e17b104d1bcb6dc1fdc4dc99ca202fd693955dfc Mon Sep 17 00:00:00 2001 From: Russell Rice Date: Wed, 20 Sep 2006 06:08:37 +0000 Subject: add extra defines when building don't crash if numlumps = 0 (which is caused when an iwad has an invalid path) Subversion-branch: /trunk/chocolate-doom Subversion-revision: 629 --- src/w_wad.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/w_wad.c b/src/w_wad.c index 61827c34..a0b103ae 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: w_wad.c 596 2006-09-02 19:10:07Z fraggle $ +// $Id: w_wad.c 629 2006-09-20 06:08:37Z rtc_marine $ // // Copyright(C) 1993-1996 Id Software, Inc. // Copyright(C) 2005 Simon Howard @@ -66,7 +66,7 @@ static const char -rcsid[] = "$Id: w_wad.c 596 2006-09-02 19:10:07Z fraggle $"; +rcsid[] = "$Id: w_wad.c 629 2006-09-20 06:08:37Z rtc_marine $"; #include @@ -595,21 +595,23 @@ void W_GenerateHashTable(void) } // Generate hash table + if (numlumps > 0) + { + lumphash = Z_Malloc(sizeof(lumpinfo_t *) * numlumps, PU_STATIC, NULL); + memset(lumphash, 0, sizeof(lumpinfo_t *) * numlumps); - lumphash = Z_Malloc(sizeof(lumpinfo_t *) * numlumps, PU_STATIC, NULL); - memset(lumphash, 0, sizeof(lumpinfo_t *) * numlumps); - - for (i=0; i