mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Planner: even with broken plans, don't divide by 0
This fixes the crash in #623, but not the other oddities. See #623 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
95dbfc22ac
commit
4eec911d3a
1 changed files with 4 additions and 2 deletions
4
dive.c
4
dive.c
|
@ -2404,8 +2404,10 @@ int average_depth(struct diveplan *dive)
|
|||
}
|
||||
dp = dp->next;
|
||||
}
|
||||
|
||||
if (last_time)
|
||||
return integral / last_time;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct picture *alloc_picture()
|
||||
|
|
Loading…
Reference in a new issue