mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +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;
|
int last_depth = 0;
|
||||||
struct divedatapoint *dp = dive->dp;
|
struct divedatapoint *dp = dive->dp;
|
||||||
|
|
||||||
|
if (!dp)
|
||||||
|
return 0;
|
||||||
|
|
||||||
while (dp) {
|
while (dp) {
|
||||||
if (dp->time) {
|
if (dp->time) {
|
||||||
/* Ignore gas indication samples */
|
/* Ignore gas indication samples */
|
||||||
|
|
Loading…
Add table
Reference in a new issue