From 9b5d3b60abca206bcbee1def5be04b22f2f89523 Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Mon, 24 Apr 2017 16:28:06 +0200 Subject: [PATCH] Do not carry po2 setpoint data over dive boundaries The file static po2 value, used to set the setpoint data, was not re-initialized at the parsing of a dive during import from the divecomputer. So, in one import session, the po2 was transferred from one dive to the next, obviously resulting in weird bugs, due to possible wrong po2 settings. Signed-off-by: Jan Mulder --- core/libdivecomputer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c index 1455e3503..cd52866fa 100644 --- a/core/libdivecomputer.c +++ b/core/libdivecomputer.c @@ -749,8 +749,8 @@ static int dive_cb(const unsigned char *data, unsigned int size, device_data_t *devdata = userdata; struct dive *dive = NULL; - /* reset the deco / ndl data */ - ndl = stoptime = stopdepth = 0; + /* reset static data, that is only valid per dive */ + ndl = stoptime = stopdepth = po2 = 0; in_deco = false; current_gas_index = -1;