summaryrefslogtreecommitdiffstats
path: root/statistics.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2011-11-02 13:27:25 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2011-11-02 13:27:25 -0700
commitba6c57083177178c2c5bfda832bc2afe03cb249f (patch)
treeb6508dfbbde73d755ff008c925529f4f3ab8f224 /statistics.c
parent619ab9e828d4db7b0c4089018b09892c9d04ece9 (diff)
downloadsubsurface-ba6c57083177178c2c5bfda832bc2afe03cb249f.tar.gz
Surface interval is calculated from the END of previous dive
Silly mistake Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'statistics.c')
-rw-r--r--statistics.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/statistics.c b/statistics.c
index 845bc2a03..56b04f283 100644
--- a/statistics.c
+++ b/statistics.c
@@ -132,7 +132,8 @@ void show_dive_stats(struct dive *dive)
set_label(info_stat_w.date, buf);
set_label(info_stat_w.dive_time, "%d min", (dive->duration.seconds + 30) / 60);
if (prev_dive)
- set_label(info_stat_w.surf_intv, get_time_string(dive->when - prev_dive->when, 4));
+ set_label(info_stat_w.surf_intv,
+ get_time_string(dive->when - (prev_dive->when + prev_dive->duration.seconds), 4));
else
set_label(info_stat_w.surf_intv, "unknown");
value = get_depth_units(dive->maxdepth.mm, &decimals, &unit);