diff options
| author | la-ninpre <leobrekalini@gmail.com> | 2021-03-30 19:59:13 +0300 |
|---|---|---|
| committer | la-ninpre <leobrekalini@gmail.com> | 2021-03-30 19:59:13 +0300 |
| commit | ccd0d09e29ed887a848bd6d79bddfc218be8ecd7 (patch) | |
| tree | ba16c428ffedb167752eeda3ad9c90089baa631e /ui-shared.c | |
| parent | d366ec1e1e796937387208ef8c26097e5ff44ae9 (diff) | |
| parent | bd6f5683f6cde4212364354b3139c1d521f40f39 (diff) | |
| download | cgit-ccd0d09e29ed887a848bd6d79bddfc218be8ecd7.tar.gz cgit-ccd0d09e29ed887a848bd6d79bddfc218be8ecd7.zip | |
Merge remote-tracking branch 'upstream/master' into git.aaoth.xyz
Diffstat (limited to 'ui-shared.c')
| -rw-r--r-- | ui-shared.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ui-shared.c b/ui-shared.c index ad5fd17..425b16c 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -22,10 +22,11 @@ static char *http_date(time_t t) static char month[][4] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; - struct tm *tm = gmtime(&t); - return fmt("%s, %02d %s %04d %02d:%02d:%02d GMT", day[tm->tm_wday], - tm->tm_mday, month[tm->tm_mon], 1900 + tm->tm_year, - tm->tm_hour, tm->tm_min, tm->tm_sec); + struct tm tm; + gmtime_r(&t, &tm); + return fmt("%s, %02d %s %04d %02d:%02d:%02d GMT", day[tm.tm_wday], + tm.tm_mday, month[tm.tm_mon], 1900 + tm.tm_year, + tm.tm_hour, tm.tm_min, tm.tm_sec); } void cgit_print_error(const char *fmt, ...) |
