]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-shared.c
git: update to v2.34.0
[ps-cgit] / ui-shared.c
index 151ac1797aa99351e63b9872d6f804eedda65431..acd8ab550d837b7928138808f572e282abda8468 100644 (file)
@@ -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, ...)