diff options
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; |