summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2013-04-22 07:00:40 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-04-22 09:06:17 -0700
commita727f55c677699019f69d4115f1b5c6f7d493f80 (patch)
treef2eecb1adaf263eda3313654d9dfba74ddf4db9c /dive.c
parentd5af4e2ff918d18e329b4753435728feae98b226 (diff)
downloadsubsurface-a727f55c677699019f69d4115f1b5c6f7d493f80.tar.gz
Retain event sort order on restart
The events that had same time stamp were reversed in order on every new load of the log file. This patch will keep the order static. (Changing order is annoying when using version control to store the logs.) Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dive.c b/dive.c
index 46121848c..34025d68c 100644
--- a/dive.c
+++ b/dive.c
@@ -25,7 +25,7 @@ void add_event(struct divecomputer *dc, int time, int type, int flags, int value
p = &dc->events;
/* insert in the sorted list of events */
- while (*p && (*p)->time.seconds < time)
+ while (*p && (*p)->time.seconds <= time)
p = &(*p)->next;
ev->next = *p;
*p = ev;