diff options
context:
space:
mode:
Diffstat (limited to 'source/ui-repolist.c')
-rw-r--r--source/ui-repolist.c8
1 file changed, 7 insertions, 1 deletion
diff --git a/source/ui-repolist.c b/source/ui-repolist.c
index fc198e5..9c4fd6f 100644
--- a/source/ui-repolist.c
+++ b/source/ui-repolist.c
@@ -242,7 +242,13 @@ static int sort_idle(const void *a, const void *b)
t1 = t2 = 0;
get_repo_modtime(r1, &t1);
get_repo_modtime(r2, &t2);
- return t2 - t1;
+ /* Return the sign only; a truncated 64-bit time_t difference could
+ * flip and make the comparator inconsistent. */
+ if (t2 > t1)
+ return 1;
+ if (t2 < t1)
+ return -1;
+ return 0;
}
static int sort_section(const void *a, const void *b)