mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
UI restructure: fix get_divenr to do the right thing on a copy of a dive
We should not care if the dive has the same address in memory. We care if it is the same dive (by using the unique ID). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
91086d08ad
commit
b298306eb1
1 changed files with 1 additions and 1 deletions
|
@ -339,7 +339,7 @@ int get_divenr(struct dive *dive)
|
|||
int i;
|
||||
struct dive *d;
|
||||
for_each_dive(i, d) {
|
||||
if (d == dive)
|
||||
if (d->id == dive->id) // don't compare pointers, we could be passing in a copy of the dive
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Reference in a new issue