(cherry picked from commit eee4431447789b2fc614144064dd61b97570e8bf)
@@ -964,7 +964,7 @@ int dr_check_freq_interval(dr_tmrec_p _trp, dr_ac_tm_p _atp)
? REC_MATCH
: REC_NOMATCH;
case FREQ_MONTHLY:
- _t0 = (_atp->t.tm_year - _trp->ts.tm_year) * 12 + _atp->t.tm_mon
+ _t0 = 12ULL * (_atp->t.tm_year - _trp->ts.tm_year) + _atp->t.tm_mon
- _trp->ts.tm_mon;
return (_t0 % _trp->interval == 0) ? REC_MATCH : REC_NOMATCH;
case FREQ_YEARLY: