mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Avoid negative array index
This case should be impossible to hit - but this seems better than assuming this can never happen. Coverity CID 1325458 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ae854ff822
commit
7cfd124f67
1 changed files with 2 additions and 2 deletions
4
dive.c
4
dive.c
|
@ -2906,9 +2906,9 @@ static int split_dive_at(struct dive *dive, int a, int b)
|
|||
fixup_dive(d1);
|
||||
fixup_dive(d2);
|
||||
|
||||
if ((i = get_divenr(dive)) < 0)
|
||||
return 0;
|
||||
|
||||
|
||||
i = get_divenr(dive);
|
||||
delete_single_dive(i);
|
||||
add_single_dive(i, d1);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue