(svn r4727) - Backport from trunk (r4688):

Fix: Ensure the map memory is cleared after it is allocated. This fixes
  random deserts that sometimes occurred.
This commit is contained in:
Darkvater 2006-05-03 21:34:07 +00:00
parent 4021f48c58
commit 2aba4c3354
1 changed files with 1 additions and 1 deletions

2
map.c
View File

@ -40,7 +40,7 @@ void AllocateMap(uint size_x, uint size_y)
_map_tile_mask = _map_size - 1;
free(_m);
_m = malloc(_map_size * sizeof(*_m));
_m = calloc(_map_size, sizeof(*_m));
// XXX TODO handle memory shortage more gracefully
if (_m == NULL) error("Failed to allocate memory for the map");