Module: kamailio
Branch: master
Commit: 7e29c28e4da5c7286a75422d6f538b932961a168
URL:
https://github.com/kamailio/kamailio/commit/7e29c28e4da5c7286a75422d6f538b9…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-02-13T09:51:51+01:00
drouting: cast to uint64_t when using time_t value
---
Modified: src/modules/drouting/dr_time.c
---
Diff:
https://github.com/kamailio/kamailio/commit/7e29c28e4da5c7286a75422d6f538b9…
Patch:
https://github.com/kamailio/kamailio/commit/7e29c28e4da5c7286a75422d6f538b9…
---
diff --git a/src/modules/drouting/dr_time.c b/src/modules/drouting/dr_time.c
index 55d09a57ca..dd601c3c4a 100644
--- a/src/modules/drouting/dr_time.c
+++ b/src/modules/drouting/dr_time.c
@@ -22,6 +22,7 @@
#include <stdio.h>
#include <string.h>
#include <time.h>
+#include <stdint.h>
#include "../../core/mem/shm_mem.h"
#include "dr_time.h"
@@ -911,7 +912,7 @@ int dr_check_tmrec(dr_tmrec_p _trp, dr_ac_tm_p _atp, dr_tr_res_p
_tsw)
int dr_check_freq_interval(dr_tmrec_p _trp, dr_ac_tm_p _atp)
{
- int _t0, _t1;
+ uint64_t _t0, _t1;
struct tm _tm;
if(!_trp || !_atp)
return REC_ERR;
@@ -929,12 +930,12 @@ int dr_check_freq_interval(dr_tmrec_p _trp, dr_ac_tm_p _atp)
_tm.tm_year = _trp->ts.tm_year;
_tm.tm_mon = _trp->ts.tm_mon;
_tm.tm_mday = _trp->ts.tm_mday;
- _t0 = (int)mktime(&_tm);
+ _t0 = (uint64_t)mktime(&_tm);
memset(&_tm, 0, sizeof(struct tm));
_tm.tm_year = _atp->t.tm_year;
_tm.tm_mon = _atp->t.tm_mon;
_tm.tm_mday = _atp->t.tm_mday;
- _t1 = (int)mktime(&_tm);
+ _t1 = (uint64_t)mktime(&_tm);
if(_trp->freq == FREQ_DAILY)
return (((_t1 - _t0) / (24 * 3600)) % _trp->interval == 0)
? REC_MATCH