Author: Jason A. Donenfeld <Jason@zx2c4.com>
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 <Jason@zx2c4.com>
ui-shared.c | 2 ++
diff --git a/ui-shared.c b/ui-shared.c index 883866d8413fa917ca5e763ac6c7ea6b10c1157a..1ede2b0bbfa4a55c49311fde04d6a5a7765d8362 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -596,6 +596,8 @@ if (!t) 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);