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 <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-01-13 20:57:52 -08:00
parent b94a93d061
commit c8a9986451

View file

@ -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 */