summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/profile.c b/profile.c
index 7839f84ff..8fc99f2e4 100644
--- a/profile.c
+++ b/profile.c
@@ -1873,12 +1873,11 @@ static void calculate_deco_information(struct dive *dive, struct divecomputer *d
t0 = (entry - 1)->sec;
t1 = entry->sec;
tissue_tolerance = 0;
- for (j = t0; j < t1; j++) {
+ for (j = t0+1; j <= t1; j++) {
int depth = interpolate(entry[-1].depth, entry[0].depth, j - t0, t1 - t0);
double min_pressure = add_segment(depth_to_mbar(depth, dive) / 1000.0,
&dive->cylinder[cylinderindex].gasmix, 1, entry->po2, dive);
- if (min_pressure > tissue_tolerance)
- tissue_tolerance = min_pressure;
+ tissue_tolerance = min_pressure;
}
if (t0 == t1)
entry->ceiling = (entry - 1)->ceiling;