Fixes dlogger PR

When applied this commit fixes the unix build of the previous dLogger PR.
This commit also fixes backwards compatability with config files.
This commit is contained in:
wincent
2021-12-13 16:57:43 +01:00
parent 81d25dd574
commit 259c236b72
6 changed files with 10 additions and 8 deletions

View File

@@ -39,10 +39,9 @@ void dLogger::vLog(const char* format, va_list args) {
mFile << "[" << timeStr << "] " << message;
#else
time_t t = time(NULL);
struct tm time;
localtime_s(&time, &t);
char timeStr[70];
strftime(timeStr, sizeof(timeStr), "%d-%m-%y %H:%M:%S", &time);
struct tm * time = localtime(&t);
char timeStr[70];
strftime(timeStr, sizeof(timeStr), "%d-%m-%y %H:%M:%S", time);
char message[2048];
vsprintf(message, format, args);