From 4e77af15c632b2fcff2ce2ba5914c5e4b2539b05 Mon Sep 17 00:00:00 2001 From: Magnus Lundborg Date: Thu, 14 Nov 2013 11:01:20 +0100 Subject: Set the molecule count correctly in tng_implicit_num_particles_set() diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c index 0c72642..62883ca 100644 --- a/src/lib/tng_io.c +++ b/src/lib/tng_io.c @@ -9745,6 +9745,10 @@ tng_function_status DECLSPECDLLEXPORT tng_implicit_num_particles_set return(stat); } stat = tng_residue_atom_add(tng_data, res, "", "", &atom); + if(stat != TNG_SUCCESS) + { + return(stat); + } } else { @@ -9761,8 +9765,8 @@ tng_function_status DECLSPECDLLEXPORT tng_implicit_num_particles_set } diff /= mol->n_atoms; } - stat = tng_molecule_cnt_set(tng_data, mol, diff); } + stat = tng_molecule_cnt_set(tng_data, mol, diff); } return(stat); -- cgit v0.10.1