about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ui-shared.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/ui-shared.c b/ui-shared.c index 1292ac9..19cd521 100644 --- a/ui-shared.c +++ b/ui-shared.c
@@ -604,19 +604,24 @@ void cgit_submodule_link(const char *class, char *path, const char *rev)
604 path[len - 1] = tail; 604 path[len - 1] = tail;
605} 605}
606 606
607void cgit_print_date(time_t secs, const char *format, int local_time) 607static const char *fmt_date(time_t secs, const char *format, int local_time)
608{ 608{
609 char buf[64]; 609 static char buf[64];
610 struct tm *time; 610 struct tm *time;
611 611
612 if (!secs) 612 if (!secs)
613 return; 613 return "";
614 if (local_time) 614 if (local_time)
615 time = localtime(&secs); 615 time = localtime(&secs);
616 else 616 else
617 time = gmtime(&secs); 617 time = gmtime(&secs);
618 strftime(buf, sizeof(buf)-1, format, time); 618 strftime(buf, sizeof(buf)-1, format, time);
619 html_txt(buf); 619 return buf;
620}
621
622void cgit_print_date(time_t secs, const char *format, int local_time)
623{
624 html_txt(fmt_date(secs, format, local_time));
620} 625}
621 626
622static void print_rel_date(time_t t, double value, 627static void print_rel_date(time_t t, double value,