From 48b88f6aca2d59419c7b1897300b4bf6bd9db893 Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Mon, 5 Jan 2015 08:00:20 +0200 Subject: Do not add uninitialized setpoint or ndl Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file.c b/file.c index d3d512566..5612f8034 100644 --- a/file.c +++ b/file.c @@ -766,9 +766,9 @@ int parse_txt_file(const char *filename, const char *csv) QT_TRANSLATE_NOOP("gettextFromC", "gaschange")); if (!has_depth) add_sample_data(sample, POSEIDON_DEPTH, prev_depth); - if (!has_setpoint) + if (!has_setpoint && prev_setpoint >= 0) add_sample_data(sample, POSEIDON_SETPOINT, prev_setpoint); - if (!has_ndl) + if (!has_ndl && prev_ndl >= 0) add_sample_data(sample, POSEIDON_NDL, prev_ndl); if (cylinder_pressure) dive->cylinder[1].sample_end.mbar = cylinder_pressure * 1000; -- cgit v1.2.3-70-g09d2