Fix localtime_r parameter
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 14s

This commit is contained in:
smallmodel 2025-01-19 01:41:26 +01:00 committed by GitHub
parent 7ab04b0bcb
commit 45de1067bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -307,12 +307,9 @@ void QDECL Com_Printf( const char *fmt, ... ) {
#ifdef WIN32
localtime_s(&tms_local, &t);
gmtime_s(&tms_gm, &t);
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
localtime_r(&t, &tms_local);
gmtime_r(&t, &tms_gm);
#else
localtime_r(&tms_local, &t);
gmtime_r(&tms_gm, &t);
localtime_r(&t, &tms_local);
gmtime_r(&t, &tms_gm);
#endif
t_gmt = mktime(&tms_gm);
tz = difftime(t, t_gmt) / 60.0 / 60.0;