From f87e8e9d2a14ec638dd497c61fbd85b1d06115ee Mon Sep 17 00:00:00 2001 From: Joshua Grams Date: Thu, 5 Jan 2006 00:09:57 +0000 Subject: [PATCH] * rocks.c (init_buckets): oops, we weren't allocating big enough arrays. --- rocks.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rocks.c b/rocks.c index a594547..0a71ebf 100644 --- a/rocks.c +++ b/rocks.c @@ -56,8 +56,10 @@ bucket(int x, int y, int p) void init_buckets(void) { - bw = (XSIZE+2*grid_size-1) / grid_size; - bh = (YSIZE+2*grid_size-1) / grid_size; + int scr_grid_w = (XSIZE+2*grid_size-1) / grid_size; + int scr_grid_h = (YSIZE+2*grid_size-1) / grid_size; + bw = 1 + scr_grid_w + 1; + bh = 1 + scr_grid_h + 1; n_buckets = bw * bh; rock_buckets[0] = malloc(n_buckets * sizeof(struct rock_struct *)); -- 1.7.10.4