Merge https://github.com/libdivecomputer/libdivecomputer into Subsurface-DS9
Merge Jef's upstream fix for the OSTC4 CCR gas parsing issue reported by Michael Keller. This also effectively obviates (and undoes) the revert I did in commit 8d3271e586cd. * https://github.com/libdivecomputer/libdivecomputer: Fix the OSTC4 diluent changes
This commit is contained in:
commit
543bd58ddd
@ -1049,8 +1049,12 @@ hw_ostc_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t call
|
||||
return DC_STATUS_DATAFORMAT;
|
||||
}
|
||||
unsigned int idx = data[offset];
|
||||
if (idx < 1 || idx > parser->ngasmixes) {
|
||||
ERROR(abstract->context, "Invalid gas mix.");
|
||||
if (parser->model == OSTC4 && ccr && idx > parser->nfixed) {
|
||||
// Fix the OSTC4 diluent index.
|
||||
idx -= parser->nfixed;
|
||||
}
|
||||
if (idx < 1 || idx > parser->nfixed) {
|
||||
ERROR(abstract->context, "Invalid gas mix (%u).", idx);
|
||||
return DC_STATUS_DATAFORMAT;
|
||||
}
|
||||
idx--; /* Convert to a zero based index. */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user