summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-02 12:42:47 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-02 12:50:00 -0700
commitb298306eb1217609e65b2817605c1115e4d4873e (patch)
treebc5cfcc63be7629f05c5bc56c4bf834a2908fe84 /divelist.c
parent91086d08ad77b693c7fd1440f9403f84acae0794 (diff)
downloadsubsurface-b298306eb1217609e65b2817605c1115e4d4873e.tar.gz
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>
Diffstat (limited to 'divelist.c')
-rw-r--r--divelist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/divelist.c b/divelist.c
index 81dd16e87..d1634a634 100644
--- a/divelist.c
+++ b/divelist.c
@@ -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;