From 8eb92c576c040b5366d3ac2511ccf579882be9a7 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 8 Jan 2013 13:43:25 -0800 Subject: Really prevent time travel in planner dive edit Commit c92e4535a6de "Prevent time travel in planner dive edit" almost got it right but had a stupid think-o. This commit should fix it the right way. If the duration that is passed in is before the previous timestamp, then this is most likely intended to be a relative time. Signed-off-by: Dirk Hohndel --- planner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'planner.c') diff --git a/planner.c b/planner.c index c43453a55..b85da235b 100644 --- a/planner.c +++ b/planner.c @@ -227,7 +227,7 @@ void add_duration_to_nth_dp(struct diveplan *diveplan, int idx, int duration, gb struct divedatapoint *pdp, *dp = get_nth_dp(diveplan, idx); if (idx > 0) { pdp = get_nth_dp(diveplan, idx - 1); - if (is_rel || dp->time <= pdp->time) + if (is_rel || duration <= pdp->time) duration += pdp->time; } dp->time = duration; -- cgit v1.2.3-70-g09d2