]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Fix up end conditions for dives
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 29 Oct 2011 22:57:26 +0000 (15:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 29 Oct 2011 22:57:26 +0000 (15:57 -0700)
We used to have the dive plot have two "filler" entries at the beginning
and the end, and indeed that is how they are allocated.  However, we fix
up "pi->nr" later to be "lastindex+1", where "lastindex" is the index of
the time we surface.

So when we loop over the plot entries, we actually need to loop all the
way to the end: use "i < pi->nr" instead of "i < pi->nr-2".

We still do have the two extra filler entries at the beginning, though.
So depending on the loop, we might want to start at entry 2.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

No differences found