diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-03-17 20:41:16 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-03-17 20:41:16 -0700 |
commit | cb53049b7495398969d45925f7823fd7588e8126 (patch) | |
tree | 9cf12207d796066d4c81604bbe367d153fa95024 /profile.c | |
parent | 17a675367d8d3b622a9793225f161d9efbf985ac (diff) | |
download | subsurface-cb53049b7495398969d45925f7823fd7588e8126.tar.gz |
Don't devide by 0 if fO2 is 100%
Fixes #465
Initial-patch-by: Anton Lundin <glance@acc.umu.se>
Better-idea-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r-- | profile.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1130,7 +1130,7 @@ static void calculate_gas_information_new(struct dive *dive, struct plot_info *p amb_pressure = depth_to_mbar(entry->depth, dive) / 1000.0; fo2 = get_o2(&dive->cylinder[cylinderindex].gasmix); fhe = get_he(&dive->cylinder[cylinderindex].gasmix); - double ratio = (double)fhe / (1000.0 - fo2); + double ratio = (fo2 == 1000) ? 0 : (double)fhe / (1000.0 - fo2); if (entry->po2) { /* we have an O2 partial pressure in the sample - so this |