Skip to content
Snippets Groups Projects
Commit 8e7fa4e4 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Added check on format of xyz lines

(cherry picked from commit 3f296491)
parent 637d25e4
No related branches found
No related tags found
No related merge requests found
......@@ -447,7 +447,8 @@ int Driver<real>::main(FILE* in,FILE*out,Communicator& pc){
double cc[3];
if(trajectory_fmt=="xyz"){
char dummy[1000];
std::sscanf(line.c_str(),"%999s %100lf %100lf %100lf",dummy,&cc[0],&cc[1],&cc[2]);
int ret=std::sscanf(line.c_str(),"%999s %100lf %100lf %100lf",dummy,&cc[0],&cc[1],&cc[2]);
if(ret!=4) error("cannot read line"+line);
} else if(trajectory_fmt=="gro"){
// do the gromacs way
if(!i){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment