use localtime_r, not localtime
This commit is contained in:
@@ -557,8 +557,9 @@ void ConditionalBGA::CheckBgaRequirements(BgaCondInfo info)
|
|||||||
{
|
{
|
||||||
time_t rawtime;
|
time_t rawtime;
|
||||||
time(&rawtime);
|
time(&rawtime);
|
||||||
struct tm* ptm = localtime(&rawtime);
|
struct tm ptm;
|
||||||
int month = ptm->tm_mon; /* Month 0..11 */
|
localtime_r( &rawtime, &ptm );
|
||||||
|
int month = ptm.tm_mon; /* Month 0..11 */
|
||||||
LOG->Info("Month: %d",month);
|
LOG->Info("Month: %d",month);
|
||||||
bool foundvalidmonth = false;
|
bool foundvalidmonth = false;
|
||||||
for(unsigned d=0;d<info.songmonths.size();d++)
|
for(unsigned d=0;d<info.songmonths.size();d++)
|
||||||
@@ -578,8 +579,9 @@ void ConditionalBGA::CheckBgaRequirements(BgaCondInfo info)
|
|||||||
{
|
{
|
||||||
time_t rawtime;
|
time_t rawtime;
|
||||||
time(&rawtime);
|
time(&rawtime);
|
||||||
struct tm* ptm = localtime(&rawtime);
|
struct tm ptm;
|
||||||
int day = ptm->tm_mday; /* day in the month */
|
localtime_r( &rawtime, &ptm );
|
||||||
|
int day = ptm.tm_mday; /* day in the month */
|
||||||
LOG->Info("DAy: %d",day);
|
LOG->Info("DAy: %d",day);
|
||||||
bool foundvalidday = false;
|
bool foundvalidday = false;
|
||||||
for(unsigned d=0;d<info.songdays.size();d++)
|
for(unsigned d=0;d<info.songdays.size();d++)
|
||||||
|
|||||||
Reference in New Issue
Block a user