Fix weird logfile date due to Jan..Dec = 0..11 in struct tm.

master
Cyp 2011-02-14 22:08:11 +01:00
parent 7a44272305
commit 577cbbf874
2 changed files with 2 additions and 1 deletions

1
.gitignore vendored
View File

@ -71,6 +71,7 @@ win32/libs/zlib/*-stamp
win32/libs/zlib/zlib-*/
win32/debug/*
win32/release/*
win32/__BUILD_CONFIG.USER
# Autogenerated files:
*.lex.[ch]

View File

@ -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)
{