aboutsummaryrefslogtreecommitdiff
path: root/src/diffraction.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-02-05 18:41:10 +0100
committerThomas White <taw@physics.org>2010-02-05 18:41:10 +0100
commit526e497f6a7266dbdf6750c1b23f1e000df1c402 (patch)
tree554c696f30d46e8cbc5b6554d693351ea95dd5f5 /src/diffraction.c
parent3c2e1af0410645b6e8c0e2b7dec8d7d07cfa9d00 (diff)
Fix obvious problems
Diffstat (limited to 'src/diffraction.c')
-rw-r--r--src/diffraction.c6
1 files changed, 3 insertions, 3 deletions
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;
}