diff options
-rw-r--r-- | divelist.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/divelist.c b/divelist.c index 36f43e4fc..18435ca29 100644 --- a/divelist.c +++ b/divelist.c @@ -820,7 +820,8 @@ void deselect_dive(int idx) struct dive *dive = get_dive(idx); if (dive && dive->selected) { dive->selected = 0; - amount_selected--; + if (amount_selected) + amount_selected--; if (selected_dive == idx && amount_selected > 0) { /* pick a different dive as selected */ while (--selected_dive >= 0) { |