From 526e497f6a7266dbdf6750c1b23f1e000df1c402 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 5 Feb 2010 18:41:10 +0100 Subject: Fix obvious problems --- src/diffraction.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/diffraction.c') diff --git a/src/diffraction.c b/src/diffraction.c index b9430ba7..b3d6bef0 100644 --- a/src/diffraction.c +++ b/src/diffraction.c @@ -157,8 +157,8 @@ void get_diffraction(struct image *image, int na, int nb, int nc, int no_sfac) STATUS("Particle size = %i x %i x %i (=%5.2f x %5.2f x %5.2f nm)\n", na, nb, nc, na*a/1.0e-9, nb*b/1.0e-9, nc*c/1.0e-9); - image->sfacs = malloc(image->width * image->height - * sizeof(double complex)); + image->sfacs = calloc(image->width * image->height, + sizeof(double complex)); if ( !no_sfac ) { if ( image->molecule->reflections == NULL ) { @@ -190,7 +190,7 @@ void get_diffraction(struct image *image, int na, int nb, int nc, int no_sfac) } val = f_molecule * f_lattice; - image->sfacs[x + image->width*y] = val; + image->sfacs[x + image->width*y] += val; } -- cgit v1.2.3