From 33b883e9a1253e9dd5607606ac7e7650666d438b Mon Sep 17 00:00:00 2001 From: Magnus Lundborg Date: Wed, 6 Nov 2013 10:46:03 +0100 Subject: Fixed bug in pointers when reading bonds. diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c index 26c8986..78d627a 100644 --- a/src/lib/tng_io.c +++ b/src/lib/tng_io.c @@ -7923,11 +7923,12 @@ tng_function_status DECLSPECDLLEXPORT tng_molsystem_bonds_get for(k = 0; k < mol->n_bonds; k++) { bond = &mol->bonds[k]; - from_atom = atom_cnt + j * mol_cnt + bond->from_atom_id; - to_atom = atom_cnt + j * mol_cnt + bond->to_atom_id; - *from_atoms[cnt] = from_atom; - *to_atoms[cnt++] = to_atom; + from_atom = atom_cnt + bond->from_atom_id; + to_atom = atom_cnt + bond->to_atom_id; + (*from_atoms)[cnt] = from_atom; + (*to_atoms)[cnt++] = to_atom; } + atom_cnt += mol->n_atoms; } } -- cgit v0.10.1