summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Lundborg <magnus.lundborg@scilifelab.se>2012-12-07 16:57:40 (GMT)
committerMagnus Lundborg <magnus.lundborg@scilifelab.se>2012-12-07 16:57:40 (GMT)
commitf4f0d515420e642e1f58ca44c831743a62aef10a (patch)
treee90a8e0348039326c29000f920aae8471c181879
parente09e982c52d3d92a1008b01190ab27073f1d490a (diff)
Fixes to make get data work (still no code to test it)
-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