summaryrefslogtreecommitdiff
path: root/src/fortune
diff options
context:
space:
mode:
authorpants <jaron@kent-dobias.com>2016-08-31 14:04:55 -0400
committerpants <jaron@kent-dobias.com>2016-08-31 14:04:55 -0400
commit7ff906b9cd27a44472b40e78e5d595ea41df1482 (patch)
treed6b3b5a930847dd52f308d34f07058928631633c /src/fortune
parent0f6782c9e5a9171d69d8e62dff33a558ba542d58 (diff)
downloadfuse_networks-7ff906b9cd27a44472b40e78e5d595ea41df1482.tar.gz
fuse_networks-7ff906b9cd27a44472b40e78e5d595ea41df1482.tar.bz2
fuse_networks-7ff906b9cd27a44472b40e78e5d595ea41df1482.zip
can generate voronoi networks with regular boundaries
Diffstat (limited to 'src/fortune')
-rw-r--r--src/fortune/main.c6
1 files changed, 3 insertions, 3 deletions
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;