summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;