Fix weird logfile date due to Jan..Dec = 0..11 in struct tm.
parent
7a44272305
commit
577cbbf874
|
@ -71,6 +71,7 @@ win32/libs/zlib/*-stamp
|
|||
win32/libs/zlib/zlib-*/
|
||||
win32/debug/*
|
||||
win32/release/*
|
||||
win32/__BUILD_CONFIG.USER
|
||||
|
||||
# Autogenerated files:
|
||||
*.lex.[ch]
|
||||
|
|
|
@ -56,7 +56,7 @@ BOOL NETstartLogging(void)
|
|||
time( &aclock ); /* Get time in seconds */
|
||||
newtime = localtime( &aclock ); /* Convert time to struct */
|
||||
|
||||
snprintf(filename, sizeof(filename), "logs/netplay-%02d%02d_%02d%02d%02d.log", newtime->tm_mon, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec );
|
||||
snprintf(filename, sizeof(filename), "logs/netplay-%04d%02d%02d_%02d%02d%02d.log", newtime->tm_year + 1900, newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec);
|
||||
pFileHandle = PHYSFS_openWrite( filename ); // open the file
|
||||
if (!pFileHandle)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue