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:
Dirk Hohndel 2014-07-15 03:14:15 -07:00
parent 95dbfc22ac
commit 4eec911d3a

4
dive.c
View file

@ -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()