diff options
author | Anton Lundin <glance@acc.umu.se> | 2014-07-10 22:11:44 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-07-10 13:26:30 -0700 |
commit | a12976086e6be3f767a223df0504262cff84996b (patch) | |
tree | 821fd73bba667b4b0a2c1946c27e0af810c46492 /dive.c | |
parent | f58bc011a7c630b2eebb4c95a728c58c8ae52962 (diff) | |
download | subsurface-a12976086e6be3f767a223df0504262cff84996b.tar.gz |
Fix potential division by zero
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r-- | dive.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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 */ |