mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Fix potential division by zero
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f58bc011a7
commit
a12976086e
1 changed files with 3 additions and 0 deletions
3
dive.c
3
dive.c
|
@ -2369,6 +2369,9 @@ int average_depth(struct diveplan *dive)
|
|||
int last_depth = 0;
|
||||
struct divedatapoint *dp = dive->dp;
|
||||
|
||||
if (!dp)
|
||||
return 0;
|
||||
|
||||
while (dp) {
|
||||
if (dp->time) {
|
||||
/* Ignore gas indication samples */
|
||||
|
|
Loading…
Reference in a new issue