diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-01-31 22:21:53 +1100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-01-31 22:31:58 +1100 |
commit | de7d5b2d5b441b3c8efa29a6b64a7685ef835768 (patch) | |
tree | af5d6154f084b1b84dd2695b44ca73b62bdaf211 /info.c | |
parent | b93f2ec6c3511ce9d0fc6d990ba97af7b8cc440d (diff) | |
download | subsurface-de7d5b2d5b441b3c8efa29a6b64a7685ef835768.tar.gz |
Make sure that the planned dive is selected
With the changes to the selection logic the selected_dive variable didn't
get updated at the end of planning a dive. With an empty dive list that
could cause selected_dive to be -1 which would subsequently cause a
SIGSEGV when trying to edit the newly created dive.
With this commit we use the shared go_to_iter() function and also make
sure that selected_dive is set correctly.
Reported-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'info.c')
-rw-r--r-- | info.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -906,7 +906,8 @@ int edit_multi_dive_info(struct dive *single_dive) master = single_dive; if (!master) master = current_dive; - + if (!master) + return 0; /* See if we should use multi dive mode */ multi = FALSE; if (!single_dive) { |