summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dive.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/dive.c b/dive.c
index e228ecb20..b303f2399 100644
--- a/dive.c
+++ b/dive.c
@@ -2404,8 +2404,10 @@ int average_depth(struct diveplan *dive)
}
dp = dp->next;
}
-
- return integral / last_time;
+ if (last_time)
+ return integral / last_time;
+ else
+ return 0;
}
struct picture *alloc_picture()