summaryrefslogtreecommitdiffstats
path: root/libdivecomputer.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdivecomputer.c')
-rw-r--r--libdivecomputer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libdivecomputer.c b/libdivecomputer.c
index 8345c859f..3a32c5d97 100644
--- a/libdivecomputer.c
+++ b/libdivecomputer.c
@@ -214,7 +214,7 @@ sample_cb(dc_sample_type_t type, dc_sample_value_t value, void *userdata)
sample->cylinderpressure.mbar = value.pressure.value * 1000 + 0.5;
break;
case DC_SAMPLE_TEMPERATURE:
- sample->temperature.mkelvin = (value.temperature + 273.15) * 1000 + 0.5;
+ sample->temperature.mkelvin = value.temperature * 1000 + ZERO_C_IN_MKELVIN + 0.5;
break;
case DC_SAMPLE_EVENT:
handle_event(dc, sample, value);