[PATCH] Fix time parsing for Divesoft Freedom

Miika Turkia miika.turkia at gmail.com
Mon Apr 25 11:23:22 PDT 2016


Divesoft uses 17 bits for time so parse accordingly.

Signed-off-by: Miika Turkia <miika.turkia at gmail.com>
---
 core/parse-xml.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/parse-xml.c b/core/parse-xml.c
index e878225..746d4ce 100644
--- a/core/parse-xml.c
+++ b/core/parse-xml.c
@@ -3441,7 +3441,7 @@ int parse_dlf_buffer(unsigned char *buffer, size_t size)
 	while (ptr < buffer + size) {
 		time = ((ptr[0] >> 4) & 0x0f) +
 			((ptr[1] << 4) & 0xff0) +
-			(ptr[2] & 0x0f) * 3600; /* hours */
+			((ptr[2] << 12) & 0x1f000);
 		event = ptr[0] & 0x0f;
 		switch (event) {
 		case 0:
-- 
2.5.0



More information about the subsurface mailing list