Linus Torvalds 37794e2e23 Be more careful about dive computer selection
The selection logic was a bit random: some places would return NULL if
the dive computer index was out of range, others would return the
primary dive computer, and actually moving between dive computers would
just blindly increment and decrement the number.

This always selects the primary computer if the index is out of bounds,
and makes sure we stay in bound when switching beteen dive computers
(but switching between dives can then turn an in-bound number into an
out-of-bounds one)

Fixes #464

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-17 10:53:49 -07:00
..
2014-02-27 20:09:57 -08:00
2014-02-27 20:09:57 -08:00
2014-02-08 08:00:27 -08:00
2014-03-03 13:29:22 -08:00
2014-02-27 11:44:59 -08:00
2013-12-04 15:49:55 -08:00
2014-02-27 20:09:57 -08:00
2014-02-27 20:09:57 -08:00
2014-03-03 21:40:56 -08:00
2014-02-27 20:09:57 -08:00
2014-03-03 13:29:22 -08:00
2014-03-15 14:56:32 -07:00
2014-02-27 20:09:57 -08:00
2014-03-07 10:03:03 -08:00