mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 21:13:23 +00:00
core: split proper divecomputer in split_divecomputer()
split_divecomputer() is passed a dive and a divecomputer number. However, it accesses the currently visible dc! This would be a nasty bug if it werent for the fact that it is called when placing an undo command and there it is passed the current dive and divecomputer anyway. Nevertheless, fix this. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
c2a7382b10
commit
0c4be83b31
1 changed files with 1 additions and 1 deletions
|
@ -3124,7 +3124,7 @@ struct dive *clone_delete_divecomputer(const struct dive *d, int dc_number)
|
|||
*/
|
||||
void split_divecomputer(const struct dive *src, int num, struct dive **out1, struct dive **out2)
|
||||
{
|
||||
struct divecomputer *srcdc = get_dive_dc(current_dive, dc_number);
|
||||
const struct divecomputer *srcdc = get_dive_dc_const(src, num);
|
||||
|
||||
if (src && srcdc) {
|
||||
// Copy the dive, but only using the selected dive computer
|
||||
|
|
Loading…
Add table
Reference in a new issue