summaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
authorGravatar Jan Darowski <jan.darowski@gmail.com>2015-06-15 00:25:43 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-14 21:20:55 -0700
commita524c01c3ff571641172a3bc393bb425dd15bc53 (patch)
treeecdecc939624515d74ba2a4575ba0cdba9971a72 /planner.c
parent77dae89b90eda203c5f418a64d2b3abf2e15e755 (diff)
downloadsubsurface-a524c01c3ff571641172a3bc393bb425dd15bc53.tar.gz
Don't compare signed and unsigned values
This fixes a "reproducable hang when using "edit dive in planner" on non-planned dive". Comparing unsigned and signed integers isn't a great idea. Fixes #880 Signed-off-by: Jan Darowski <jan.darowski@gmail.com> 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 ad855e619..c8578c320 100644
--- a/planner.c
+++ b/planner.c
@@ -1028,7 +1028,7 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool
TIMESTEP, po2, &displayed_dive, prefs.decosac);
clock += TIMESTEP;
depth -= deltad;
- } while (depth > stoplevels[stopidx]);
+ } while (depth > 0 && depth > stoplevels[stopidx]);
if (depth <= 0)
break; /* We are at the surface */