mirror of
https://git.zx2c4.com/cgit
synced 2024-11-22 08:28:42 +00:00
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>
This commit is contained in:
parent
9dde6d38e9
commit
bb3cc0d966
@ -596,6 +596,8 @@ void cgit_print_age(time_t t, time_t max_relative, const char *format)
|
|||||||
return;
|
return;
|
||||||
time(&now);
|
time(&now);
|
||||||
secs = now - t;
|
secs = now - t;
|
||||||
|
if (secs < 0)
|
||||||
|
secs = 0;
|
||||||
|
|
||||||
if (secs > max_relative && max_relative >= 0) {
|
if (secs > max_relative && max_relative >= 0) {
|
||||||
cgit_print_date(t, format, ctx.cfg.local_time);
|
cgit_print_date(t, format, ctx.cfg.local_time);
|
||||||
|
Loading…
Reference in New Issue
Block a user