summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMagnus Lundborg <lundborg.magnus@gmail.com>2013-10-25 08:25:42 (GMT)
committerMagnus Lundborg <lundborg.magnus@gmail.com>2013-10-25 08:25:42 (GMT)
commit2ae890547ab92eefa31307b48676917b5fb15871 (patch)
tree6b4b10e61de6885707065c0bdf9e23bbdc820a57 /src
parent3ba1ce617e1fac04bffe6a7f9aef5b32eace8b69 (diff)
Check that writing frequency is OK before setting it.
In the high-level API return TNG_FAILURE if the specified writing frequency is <= 0. Also give an error message. In the low-level API this is silently fixed by setting it to at least 1. Fixes #1366.
Diffstat (limited to 'src')
-rw-r--r--src/lib/tng_io.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c
index a8f9a02..74a5228 100644
--- a/src/lib/tng_io.c
+++ b/src/lib/tng_io.c
@@ -14964,6 +14964,13 @@ tng_function_status DECLSPECDLLEXPORT tng_util_generic_write_frequency_set
return(stat);
}
+ if(f <= 0)
+ {
+ printf("Cannot set writing frequency to %"PRId64". %s: %d\n",
+ f, __FILE__, __LINE__);
+ return(TNG_FAILURE);
+ }
+
frame_set = &tng_data->current_trajectory_frame_set;
if(!frame_set || tng_data->n_trajectory_frame_sets <= 0)
contact: Jan Huwald // Impressum