From: Joshua Grams Date: Thu, 5 Jan 2006 00:09:57 +0000 (+0000) Subject: * rocks.c (init_buckets): oops, we weren't allocating big enough arrays. X-Git-Tag: 0.4~37 X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=commitdiff_plain;h=f87e8e9d2a14ec638dd497c61fbd85b1d06115ee * rocks.c (init_buckets): oops, we weren't allocating big enough arrays. --- 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 *));