summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2015-01-05 08:00:20 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-04 23:11:03 -0800
commit48b88f6aca2d59419c7b1897300b4bf6bd9db893 (patch)
tree2a16c5274157b0df82b6c517b5413c332df68d13 /file.c
parentd39eb81bfb02eebb2aa5406f8ecc6f3641bb462f (diff)
downloadsubsurface-48b88f6aca2d59419c7b1897300b4bf6bd9db893.tar.gz
Do not add uninitialized setpoint or ndl
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files 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;