diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-01-13 20:57:52 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-01-13 21:00:49 -0800 |
commit | c8a99864512eebeb705b495c7aba4da1ff8a5816 (patch) | |
tree | f343a092ac2084e6367b1a5125d44b4d73e3cc10 /divelist.c | |
parent | b94a93d06154a7b245e374512592fc25d8e58370 (diff) | |
download | subsurface-c8a99864512eebeb705b495c7aba4da1ff8a5816.tar.gz |
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>
Diffstat (limited to 'divelist.c')
-rw-r--r-- | divelist.c | 2 |
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 */ |