From fc20e59fa1911aae360e5deac9d48784062f2d2e Mon Sep 17 00:00:00 2001 From: LoudSnorer Date: Fri, 9 Jun 2023 14:44:42 -0400 Subject: [PATCH] Negative session length -> now session length returns zero --- oscar/SleepLib/session.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/oscar/SleepLib/session.h b/oscar/SleepLib/session.h index e1d137f8..944bd70b 100644 --- a/oscar/SleepLib/session.h +++ b/oscar/SleepLib/session.h @@ -132,7 +132,8 @@ class Session //! \brief Return the millisecond length of this session qint64 length() { - return s_last - s_first; + qint64 duration=s_last - s_first; + return duration<0?0:duration; // qint64 t; // int size = m_slices.size(); // if (size == 0) {