summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.c b/main.c
index ca3722383..ff874834c 100644
--- a/main.c
+++ b/main.c
@@ -126,12 +126,16 @@ void report_dives(gboolean is_imported)
struct dive **pp = &dive_table.dives[i-1];
struct dive *prev = pp[0];
struct dive *dive = pp[1];
+ struct dive *next;
struct dive *merged;
if (prev->when + prev->duration.seconds < dive->when)
continue;
- merged = try_to_merge(prev, dive);
+ next = NULL;
+ if (i < dive_table.nr-1)
+ next = pp[2];
+ merged = try_to_merge(prev, dive, next);
if (!merged)
continue;