From bb3cc0d9666553608b7c89aef84d21d3312ce488 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 17 Jan 2014 15:41:41 +0100 Subject: ui-shared: do not allow negative minutes Do to timestamp differences, sometimes cgit would should "-0 min", which doesn't make any sense. Signed-off-by: Jason A. Donenfeld --- ui-shared.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui-shared.c b/ui-shared.c index 883866d..1ede2b0 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -596,6 +596,8 @@ void cgit_print_age(time_t t, time_t max_relative, const char *format) return; time(&now); secs = now - t; + if (secs < 0) + secs = 0; if (secs > max_relative && max_relative >= 0) { cgit_print_date(t, format, ctx.cfg.local_time); -- cgit v1.2.1