parser: fix DLF import
In bc3b56a9690, the import of the dive mode was simplified, by replacing an if-else-if chain by bit manipulations. However, the bitmask was wrong: 0b00111000 is 0x38 not 0x30, which means that "odd" dive modes were not recognized as such. Bug found by coverity. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
32bc034f41
commit
c897edc13e
@ -1854,7 +1854,7 @@ int parse_dlf_buffer(unsigned char *buffer, size_t size, struct dive_table *tabl
|
||||
// ptr[14] >> 1 is scrubber used in %
|
||||
|
||||
// 3 bit dive type
|
||||
switch((ptr[15] & 0x30) >> 3) {
|
||||
switch((ptr[15] & 0x38) >> 3) {
|
||||
case 0: // unknown
|
||||
case 1:
|
||||
state.cur_dc->divemode = OC;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user