From: Linus Torvalds <[email protected]>
Date: Wed, 12 Feb 2014 14:11:21 -0800
Subject: [PATCH 1/2] Fix default value for missing surface pressure from 
divecomputer

We should *not* default to the incorrect "1 bar".  Instead, we should
leave the resuling pressure at 0 mbar, which leaves visual entries empty
and uses the default surface pressure for calculations.

Reported-by: Pedro Neves <[email protected]>
Cc: Patrick Valsecchi <[email protected]>
Cc: Dirk Hohndel <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
---
 libdivecomputer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libdivecomputer.c b/libdivecomputer.c
index b3cc1d5f7845..f93b2c0fc9bb 100644
--- a/libdivecomputer.c
+++ b/libdivecomputer.c
@@ -476,7 +476,7 @@ static int dive_cb(const unsigned char *data, unsigned int 
size,
        }
        dive->dc.salinity = salinity.density * 10.0 + 0.5;
 
-       double surface_pressure = 1.0;
+       double surface_pressure = 0;
        rc = dc_parser_get_field(parser, DC_FIELD_ATMOSPHERIC, 0, 
&surface_pressure);
        if (rc != DC_STATUS_SUCCESS && rc != DC_STATUS_UNSUPPORTED) {
                dev_info(devdata, translate("gettextFromC","Error obtaining 
surface pressure"));
-- 
1.9.0.rc3


_______________________________________________
subsurface mailing list
[email protected]
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to