diff options
Diffstat (limited to 'src/tests/tng_io_read_pos_util.c')
-rw-r--r-- | src/tests/tng_io_read_pos_util.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/tests/tng_io_read_pos_util.c b/src/tests/tng_io_read_pos_util.c index e7b00d3..22e75d5 100644 --- a/src/tests/tng_io_read_pos_util.c +++ b/src/tests/tng_io_read_pos_util.c @@ -73,8 +73,11 @@ int main(int argc, char **argv) last_frame = tot_n_frames - 1; } + + n_frames = last_frame - first_frame + 1; + if(tng_util_box_shape_read(traj, &box_shape, &stride_length) == - TNG_SUCCESS) + TNG_SUCCESS) { printf("Simulation box shape: "); for(i=0; i < 9; i++) @@ -88,9 +91,6 @@ int main(int argc, char **argv) printf("Simulation box shape not set in the file (or could not be read)\n"); } - n_frames = last_frame - first_frame + 1; - - // Get the positions of all particles in the requested frame range. // The positions are stored in the positions array. // N.B. No proper error checks. @@ -123,6 +123,10 @@ int main(int argc, char **argv) { free(positions); } + if(box_shape) + { + free(box_shape); + } tng_util_trajectory_close(&traj); return(0); |