From c4b694fdb1876b72143c465c933517d27eac4ab0 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Sun, 12 Sep 2021 19:07:44 +0200 Subject: [PATCH] Fix the salinity parsing The parser->mode field is only initialized at the end of the function. The result is that the current code always used the default value (zero). Inside the function itself, the local variable should be used instead. --- src/mares_iconhd_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mares_iconhd_parser.c b/src/mares_iconhd_parser.c index a9ca390..15fab95 100644 --- a/src/mares_iconhd_parser.c +++ b/src/mares_iconhd_parser.c @@ -266,7 +266,7 @@ mares_iconhd_cache (mares_iconhd_parser_t *parser) unsigned int settings = 0; if (parser->model == SMARTAPNEA) { settings = array_uint16_le (p + 0x1C); - } else if (parser->mode == ICONHD_FREEDIVE) { + } else if (mode == ICONHD_FREEDIVE) { settings = array_uint16_le (p + 0x08); } else { settings = array_uint16_le (p + 0x0C);