aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2015-02-17 19:27:59 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-17 14:07:11 -0800
commit5632c0b357bef09555b475212b619cb2eaddd7d5 (patch)
tree08f1d6807b59b6268148a7cb596ad2d728560a96
parent56f6df4cd8721664258497fb950f4ae2b3cf41e6 (diff)
downloadsubsurface-5632c0b357bef09555b475212b619cb2eaddd7d5.tar.gz
Add limits to cylinder maximum pressures on DM5 import
DM5 seems to have occasionally bogus data for cylinder start and end pressures. Need to validate that. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--parse-xml.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/parse-xml.c b/parse-xml.c
index 5a49e2af8..b11970137 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -2220,11 +2220,11 @@ extern int dm5_dive(void *param, int columns, char **data, char **column)
* TODO: handle multiple cylinders
*/
cylinder_start();
- if (data[22] && atoi(data[22]) > 0)
+ if (data[22] && atoi(data[22]) > 0 && atoi(data[22]) < 350000)
cur_dive->cylinder[cur_cylinder_index].start.mbar = atoi(data[22]);
else if (data[10] && atoi(data[10]) > 0)
cur_dive->cylinder[cur_cylinder_index].start.mbar = atoi(data[10]);
- if (data[23] && atoi(data[23]) > 0)
+ if (data[23] && atoi(data[23]) > 0 && atoi(data[23]) < 350000)
cur_dive->cylinder[cur_cylinder_index].end.mbar = (atoi(data[23]));
if (data[11] && atoi(data[11]) > 0)
cur_dive->cylinder[cur_cylinder_index].end.mbar = (atoi(data[11]));