From 6d6faabebf46fd312b81fa454d22ccbad641be65 Mon Sep 17 00:00:00 2001 From: Giovanni Bussi <giovanni.bussi@gmail.com> Date: Thu, 7 Nov 2013 12:44:47 +0100 Subject: [PATCH] Addresses #53 Now crashed when wrong keywords are used in COORDINATION SWITCH=... --- src/colvar/Coordination.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/colvar/Coordination.cpp b/src/colvar/Coordination.cpp index fd1aa8b0e..7f3d0d0f6 100644 --- a/src/colvar/Coordination.cpp +++ b/src/colvar/Coordination.cpp @@ -84,8 +84,10 @@ CoordinationBase(ao) string sw,errors; parse("SWITCH",sw); - if(sw.length()>0) switchingFunction.set(sw,errors); - else { + if(sw.length()>0){ + switchingFunction.set(sw,errors); + if( errors.length()!=0 ) error("problem reading SWITCH keyword : " + errors ); + } else { int nn=6; int mm=12; double d0=0.0; -- GitLab