diff options
author | Magnus Lundborg <lundborg.magnus@gmail.com> | 2013-10-17 13:55:04 (GMT) |
---|---|---|
committer | Magnus Lundborg <lundborg.magnus@gmail.com> | 2013-10-17 13:55:04 (GMT) |
commit | d2feec238154abc11a0ac671fb5043b3fa6fafe5 (patch) | |
tree | 2c17c21be8dcb051cbccad2b1294e08b5a3e8016 /src | |
parent | 25b614f697ebb35b9166828bb87c78590d6850fa (diff) |
Do not use molecule pointer when allocing for bonds.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/tng_io.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c index fac759f..516ad86 100644 --- a/src/lib/tng_io.c +++ b/src/lib/tng_io.c @@ -2455,8 +2455,8 @@ static tng_function_status tng_molecules_block_read if(molecule->n_bonds > 0) { - molecule->bonds = malloc(molecule->n_bonds * - sizeof(struct tng_bond)); + tng_data->molecules[i].bonds = malloc(molecule->n_bonds * + sizeof(struct tng_bond)); if(!molecule->bonds) { printf("Cannot allocate memory (%"PRId64" bytes). %s: %d\n", |