aboutsummaryrefslogtreecommitdiff
path: root/src/ambigator.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-03-06 17:55:58 +0100
committerThomas White <taw@physics.org>2014-03-06 17:55:58 +0100
commita2637fde88a99e222c98a15ed214f673a083821d (patch)
treecf5ea3dbd4e77a26597442872d74726ca6989547 /src/ambigator.c
parentfc647d846dc8fbec9ef13c41382be260ff5e8e9a (diff)
Don't break if there are no reflections in the list
Diffstat (limited to 'src/ambigator.c')
-rw-r--r--src/ambigator.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ambigator.c b/src/ambigator.c
index fe295cf7..018ed186 100644
--- a/src/ambigator.c
+++ b/src/ambigator.c
@@ -245,6 +245,11 @@ static float corr(struct flist *a, struct flist *b, int *pn, int a_reidx)
ia = a->i;
}
+ if ( (a->n == 0) || (b->n == 0) ) {
+ *pn = 0;
+ return 0.0;
+ }
+
while ( 1 ) {
while ( sa[ap] > b->s[bp] ) {