summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Lundborg <lundborg.magnus@gmail.com>2013-11-06 09:46:03 (GMT)
committerMagnus Lundborg <lundborg.magnus@gmail.com>2013-11-06 09:46:03 (GMT)
commit33b883e9a1253e9dd5607606ac7e7650666d438b (patch)
tree0aa781f96f1ff2a71806a47e9ba705f4f93f7659
parent13144fd65c0c9b769006a7a7393a922befb311c1 (diff)
Fixed bug in pointers when reading bonds.
-rw-r--r--src/lib/tng_io.c9
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;
}
}
contact: Jan Huwald // Impressum