mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
parser: fix DLF import
In bc3b56a969
, 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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue