From c8a99864512eebeb705b495c7aba4da1ff8a5816 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 13 Jan 2013 20:57:52 -0800 Subject: Make sure init_decompression works for dive 0 as well The loop would actually get entered for dive 0 and try to compare things with dive -1. Which of course fails. Signed-off-by: Dirk Hohndel --- divelist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'divelist.c') 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 */ -- cgit v1.2.3-70-g09d2