diff options
author | Magnus Lundborg <lundborg.magnus@gmail.com> | 2014-06-18 12:51:21 (GMT) |
---|---|---|
committer | Magnus Lundborg <lundborg.magnus@gmail.com> | 2014-06-18 12:51:21 (GMT) |
commit | 16df17c0481e58c2d2112780df1ed5f80b140ee8 (patch) | |
tree | 8b4ac9be2e1b13a05ef7086b80c7fce3bc838d7c /src/lib | |
parent | 5f37b8a83c0fcbd5887f42dbbf003ad986df352a (diff) |
Bug fix. Did not look through all chains.
Always set the residues in the chain when adding residues.
Change-Id: I785b829ab3ae68fa5ac39ba2accf02ce22a03fab
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/tng_io.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c index 852be78..fb6089c 100644 --- a/src/lib/tng_io.c +++ b/src/lib/tng_io.c @@ -8422,7 +8422,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_chain_find n_chains = molecule->n_chains; - for(i = n_chains - 1; i > 0; i--) + for(i = n_chains - 1; i >= 0; i--) { *chain = &molecule->chains[i]; if(name[0] == 0 || strcmp(name, (*chain)->name) == 0) @@ -8800,6 +8800,10 @@ tng_function_status DECLSPECDLLEXPORT tng_chain_residue_w_id_add { chain->residues = *residue; } + else + { + chain->residues = &molecule->residues[curr_index]; + } (*residue)->name = 0; tng_residue_name_set(tng_data, *residue, name); |