From fe7169fd13ac23ff85a7c4493f6c35e34ce6130e Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 8 May 2015 18:29:20 +0200 Subject: Refuse to make OSFs negative --- src/post-refinement.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3