From 9c26da3e292d420982e58fb3dfcc62ebfd8c1d6e Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 25 Nov 2015 12:08:28 -0800 Subject: [PATCH] Don't overwrite air temperature If we already have an air temperature set, don't overwrite it with potentially less accurate infromation from the first sample. Signed-off-by: Dirk Hohndel --- libdivecomputer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdivecomputer.c b/libdivecomputer.c index ca8378379..8ed29edd7 100644 --- a/libdivecomputer.c +++ b/libdivecomputer.c @@ -695,7 +695,7 @@ static int dive_cb(const unsigned char *data, unsigned int size, dc_parser_destroy(parser); /* Various libdivecomputer interface fixups */ - if (first_temp_is_air && dive->dc.samples) { + if (dive->dc.airtemp.mkelvin == 0 && first_temp_is_air && dive->dc.samples) { dive->dc.airtemp = dive->dc.sample[0].temperature; dive->dc.sample[0].temperature.mkelvin = 0; }