]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sys_shared.c
open client sockets before video starts, so that the Windows Firewall
[xonotic/darkplaces.git] / sys_shared.c
index e332f23b110246310393d4dd5d5fbc8cd2bb7d93..91f72d41294aa9d14d6572ca6f3a09ee7b3a5d3b 100644 (file)
@@ -10,7 +10,13 @@ static char sys_timestring[128];
 char *Sys_TimeString(const char *timeformat)
 {
        time_t mytime = time(NULL);
+#if _MSC_VER >= 1400
+       struct tm mytm;
+       localtime_s(&mytm, &mytime);
+       strftime(sys_timestring, sizeof(sys_timestring), timeformat, &mytm);
+#else
        strftime(sys_timestring, sizeof(sys_timestring), timeformat, localtime(&mytime));
+#endif
        return sys_timestring;
 }