1
0
Fork 0
mirror of https://github.com/subsurface/subsurface.git synced 2025-02-19 22:16:15 +00:00

Planner: even with broken plans, don't divide by 0

This fixes the crash in , but not the other oddities.

See 

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-07-15 03:14:15 -07:00
parent 95dbfc22ac
commit 4eec911d3a

6
dive.c
View file

@ -2404,8 +2404,10 @@ int average_depth(struct diveplan *dive)
} }
dp = dp->next; dp = dp->next;
} }
if (last_time)
return integral / last_time; return integral / last_time;
else
return 0;
} }
struct picture *alloc_picture() struct picture *alloc_picture()