From 7ff906b9cd27a44472b40e78e5d595ea41df1482 Mon Sep 17 00:00:00 2001 From: pants Date: Wed, 31 Aug 2016 14:04:55 -0400 Subject: can generate voronoi networks with regular boundaries --- src/fortune/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/fortune') diff --git a/src/fortune/main.c b/src/fortune/main.c index 543f6e4..a1a4372 100644 --- a/src/fortune/main.c +++ b/src/fortune/main.c @@ -95,8 +95,8 @@ intptr_t *run_voronoi(unsigned int num, double *lattice, bool periodic, double x double *eff_lattice = lattice; if (periodic) { - unsigned int eff_num = 9 * num; - double *eff_lattice = (double *)malloc(2 * eff_num * sizeof(double)); + eff_num = 9 * num; + eff_lattice = (double *)malloc(2 * eff_num * sizeof(double)); for (unsigned int i = 0; i < num; i++) { // original sites - our baby boys @@ -139,7 +139,7 @@ intptr_t *run_voronoi(unsigned int num, double *lattice, bool periodic, double x nsites = eff_num; readsites(eff_lattice); - free(eff_lattice); + if (periodic) free(eff_lattice); next = nextone; siteidx = 0; -- cgit v1.2.3-70-g09d2