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 <nevesdiver@gmail.com>
Cc: Patrick Valsecchi <patrick@thus.ch>
Cc: Dirk Hohndel <dirk@hohndel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Linus Torvalds 2014-02-12 14:11:21 -08:00 committed by Dirk Hohndel
parent 730e0295c9
commit 7ae05b4f71

View file

@ -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"));