Let's do the bit shift properly and not by block size.

Fixes #906

Signed-off-by: Miika Turkia <[email protected]>
---
How on earth did someone write this stupid bug, and how did it get
accepted? There must have been more than one guy needing coffee :D
---
 parse-xml.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/parse-xml.c b/parse-xml.c
index 7c8d6bd..d8094db 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -2385,7 +2385,7 @@ extern int dm5_dive(void *param, int columns, char 
**data, char **column)
        for (i = 0; interval && sampleBlob && i * interval < 
cur_dive->duration.seconds; i++) {
                float *depth = (float *)&sampleBlob[i * block_size + 3];
                int32_t temp = (sampleBlob[i * block_size + 10] << 8) + 
sampleBlob[i * block_size + 11];
-               int32_t pressure = (sampleBlob[i * block_size + 9] << 
block_size) + (sampleBlob[i * block_size + 8] << 8) + sampleBlob[i * block_size 
+ 7];
+               int32_t pressure = (sampleBlob[i * block_size + 9] << 16) + 
(sampleBlob[i * block_size + 8] << 8) + sampleBlob[i * block_size + 7];
 
                sample_start();
                cur_sample->time.seconds = i * interval;
-- 
2.1.4

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to