summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
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 0cf4d7be0..68274eafe 100644
--- a/divelist.c
+++ b/divelist.c
@@ -858,7 +858,7 @@ double init_decompression(struct dive *dive)
;
when = dive->when;
i = divenr;
- while (--i) {
+ while (i && --i) {
struct dive* pdive = get_dive(i);
/* we don't want to mix dives from different trips as we keep looking
* for how far back we need to go */