From 7ae05b4f710fc0d03a2198397e7dd779f477fd79 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 12 Feb 2014 14:11:21 -0800 Subject: [PATCH] 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 Cc: Patrick Valsecchi Cc: Dirk Hohndel Signed-off-by: Linus Torvalds Signed-off-by: Dirk Hohndel --- libdivecomputer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdivecomputer.c b/libdivecomputer.c index b3cc1d5f7..f93b2c0fc 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"));