summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/tng_io.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c
index d07861a..0c60145 100644
--- a/src/lib/tng_io.c
+++ b/src/lib/tng_io.c
@@ -6931,6 +6931,9 @@ tng_function_status tng_data_get(tng_trajectory_t tng_data,
/* A bit hackish to create a new data struct before returning the data */
new_data = malloc(sizeof(struct tng_data));
+ new_data->n_values_per_frame = 0;
+ new_data->n_frames = 0;
+ new_data->values = 0;
tng_allocate_data_mem(tng_data, new_data, data->n_frames,
data->n_values_per_frame);
@@ -6953,7 +6956,7 @@ tng_function_status tng_data_get(tng_trajectory_t tng_data,
memcpy(new_data->values, data->values, size * data->n_frames *
data->n_values_per_frame);
- values = &new_data->values;
+ *values = new_data->values;
return(TNG_SUCCESS);
}
@@ -7028,7 +7031,6 @@ tng_function_status tng_particle_data_get(tng_trajectory_t tng_data,
/* A bit hackish to create a new data struct before returning the data */
new_data = malloc(sizeof(struct tng_particle_data));
-
new_data->n_values_per_frame = 0;
new_data->n_frames = 0;
contact: Jan Huwald // Impressum