kioslave: CodeQL warning fix

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-06-14 12:33:40 +03:00
parent e0cbdd94f3
commit c91cef75ef

View file

@ -1782,7 +1782,12 @@ bool Ftp::ftpReadDir(FtpEntry& de)
// First get current time - we need the current month and year
time_t currentTime = time( 0L );
#ifdef _POSIX_THREAD_SAFE_FUNCTIONS
struct tm tmpres;
struct tm * tmptr = gmtime_r(&currentTime, &tmpres);
#else
struct tm * tmptr = gmtime( &currentTime );
#endif
int currentMonth = tmptr->tm_mon;
//kDebug(7102) << "Current time :" << asctime( tmptr );
// Reset time fields