summaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-08 13:43:25 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-08 13:43:25 -0800
commit8eb92c576c040b5366d3ac2511ccf579882be9a7 (patch)
treef64427affe843ee42caf75dc91bfcae336106b7b /planner.c
parent8b24784a7a5886b23815f9b4657400596f1fe274 (diff)
downloadsubsurface-8eb92c576c040b5366d3ac2511ccf579882be9a7.tar.gz
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 <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r--planner.c2
1 files changed, 1 insertions, 1 deletions
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;