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:
Anton Lundin 2014-07-10 22:11:44 +02:00 committed by Dirk Hohndel
parent f58bc011a7
commit a12976086e

3
dive.c
View file

@ -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 */