mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Core: set gas use to zero if no values are given
In get_gas_used() the use was left uninitialized if there are neither user- nor computer-supplied values. This gives random SACs in the UI. Initialize to 0. Fixes #2376. Reported-by: Stefan Fuchs <sfuchs@gmx.de> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
2f77716e8f
commit
065559c3d8
1 changed files with 2 additions and 0 deletions
|
@ -376,6 +376,8 @@ volume_t *get_gas_used(struct dive *dive)
|
|||
end = cyl->end.mbar ? cyl->end : cyl->sample_end;
|
||||
if (end.mbar && start.mbar > end.mbar)
|
||||
gases[idx].mliter = gas_volume(cyl, start) - gas_volume(cyl, end);
|
||||
else
|
||||
gases[idx].mliter = 0;
|
||||
}
|
||||
|
||||
return gases;
|
||||
|
|
Loading…
Add table
Reference in a new issue