summaryrefslogtreecommitdiffstats
path: root/libdivecomputer.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-10-27 18:03:13 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-10-27 18:04:20 -0700
commitb63a5f0de6961dc483ec655c5046a3d833bf5227 (patch)
tree30714772c7a57bac1df685f45a6880110f4d1b81 /libdivecomputer.c
parent2be4a9f96126999bd91abbaf0d4ef1e3583e07f3 (diff)
downloadsubsurface-b63a5f0de6961dc483ec655c5046a3d833bf5227.tar.gz
Correct handling of O2 values below 21%
We incorrectly "fixed" those to be 21%. Not useful when diving trimix. Fixes #4 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'libdivecomputer.c')
-rw-r--r--libdivecomputer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libdivecomputer.c b/libdivecomputer.c
index 8c5a4f180..e3153572a 100644
--- a/libdivecomputer.c
+++ b/libdivecomputer.c
@@ -60,7 +60,7 @@ static int parse_gasmixes(device_data_t *devdata, struct dive *dive, dc_parser_t
he = gasmix.helium * 1000 + 0.5;
/* Ignore bogus data - libdivecomputer does some crazy stuff */
- if (o2 <= AIR_PERMILLE || o2 >= 1000)
+ if (o2 + he <= AIR_PERMILLE || o2 >= 1000)
o2 = 0;
if (he < 0 || he >= 800 || o2+he >= 1000)
he = 0;