[PATCH] Do not add uninitialized setpoint or ndl

Miika Turkia miika.turkia at gmail.com
Sun Jan 4 22:00:20 PST 2015


Signed-off-by: Miika Turkia <miika.turkia at gmail.com>
---
 file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/file.c b/file.c
index d3d5125..5612f80 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;
-- 
1.9.1



More information about the subsurface mailing list