Skip to content

Commit

Permalink
fix Windows log
Browse files Browse the repository at this point in the history
  • Loading branch information
tildearrow committed Apr 1, 2023
1 parent 2255bdf commit cc697ab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,18 @@ void initLog() {
logFileAvail=false;

time_t curTime=time(NULL);
#ifdef _WIN32
struct tm* curDay;
curDay=localtime(&curTime);
if (curDay!=NULL) {
dejarteArriba=(curDay->tm_mon==3 && (curDay->tm_mday==1 || curDay->tm_mday==2));
}
#else
struct tm curDay;
if (localtime_r(&curTime,&curDay)!=NULL) {
dejarteArriba=(curDay.tm_mon==3 && (curDay.tm_mday==1 || curDay.tm_mday==2));
}
#endif
}

void _logFileThread() {
Expand Down

0 comments on commit cc697ab

Please sign in to comment.