diff options
author | Magnus Lundborg <lundborg.magnus@gmail.com> | 2013-11-06 09:46:03 (GMT) |
---|---|---|
committer | Magnus Lundborg <lundborg.magnus@gmail.com> | 2013-11-06 09:46:03 (GMT) |
commit | 33b883e9a1253e9dd5607606ac7e7650666d438b (patch) | |
tree | 0aa781f96f1ff2a71806a47e9ba705f4f93f7659 | |
parent | 13144fd65c0c9b769006a7a7393a922befb311c1 (diff) |
Fixed bug in pointers when reading bonds.
-rw-r--r-- | src/lib/tng_io.c | 9 |
1 files changed, 5 insertions, 4 deletions
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; } } |