summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
Diffstat (limited to 'divelist.c')
-rw-r--r--divelist.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/divelist.c b/divelist.c
index 229ea19c8..8bad4828d 100644
--- a/divelist.c
+++ b/divelist.c
@@ -793,10 +793,12 @@ struct dive *merge_two_dives(struct dive *a, struct dive *b)
{
struct dive *res;
int i, j;
- int id = a->id;
+ int id;
if (!a || !b)
return NULL;
+
+ id = a->id;
i = get_divenr(a);
j = get_divenr(b);
res = merge_dives(a, b, b->when - a->when, false);