aboutsummaryrefslogtreecommitdiff
path: root/src/post-refinement.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2015-05-08 18:29:20 +0200
committerThomas White <taw@physics.org>2015-05-13 13:48:33 +0200
commitfe7169fd13ac23ff85a7c4493f6c35e34ce6130e (patch)
treeeb751bcc4f9b2d4662677ff619c3b1d73f38370c /src/post-refinement.c
parentd40b00f74a77c1f9d61158b9e945368f4c5bb64b (diff)
Refuse to make OSFs negative
Diffstat (limited to 'src/post-refinement.c')
-rw-r--r--src/post-refinement.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/post-refinement.c b/src/post-refinement.c
index e0436d8a..45966eb8 100644
--- a/src/post-refinement.c
+++ b/src/post-refinement.c
@@ -291,7 +291,11 @@ static void apply_shift(Crystal *cr, int k, double shift)
} else {
t = crystal_get_osf(cr);
t += shift;
- crystal_set_osf(cr, t);
+ if ( t < 0.0 ) {
+ ERROR("Refusing to make OSF negative.\n");
+ } else {
+ crystal_set_osf(cr, t);
+ }
}
break;