summaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse-xml.c')
-rw-r--r--parse-xml.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/parse-xml.c b/parse-xml.c
index 86ef31ade..dfe6a616e 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -600,6 +600,11 @@ static void sample_end(void)
if (sample->depth.mm > dive->maxdepth.mm)
dive->maxdepth.mm = sample->depth.mm;
+ if (sample->temperature.mkelvin) {
+ if (!dive->watertemp.mkelvin || dive->watertemp.mkelvin > sample->temperature.mkelvin)
+ dive->watertemp = sample->temperature;
+ }
+
sample = NULL;
dive->samples++;
}