Module: kamailio
Branch: master
Commit: 3e6cd549716ab7ee0b2ff0df3ee52784d9478ee1
URL:
https://github.com/kamailio/kamailio/commit/3e6cd549716ab7ee0b2ff0df3ee5278…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-08-24T14:00:01+02:00
cplc: casts for proper adjusting on storage size
---
Modified: src/modules/cplc/cpl_time.c
---
Diff:
https://github.com/kamailio/kamailio/commit/3e6cd549716ab7ee0b2ff0df3ee5278…
Patch:
https://github.com/kamailio/kamailio/commit/3e6cd549716ab7ee0b2ff0df3ee5278…
---
diff --git a/src/modules/cplc/cpl_time.c b/src/modules/cplc/cpl_time.c
index 4120f4ef2bf..b22fe5e8cf9 100644
--- a/src/modules/cplc/cpl_time.c
+++ b/src/modules/cplc/cpl_time.c
@@ -264,7 +264,7 @@ int cpl_ac_print(cpl_ac_tm_p _atp)
return -1;
}
- printf("\nSys time: %d\nTime: %02d:%02d:%02d\n", (int)_atp->time,
+ printf("\nSys time: %llu\nTime: %02d:%02d:%02d\n", (unsigned long
long)_atp->time,
_atp->t.tm_hour, _atp->t.tm_min, _atp->t.tm_sec);
printf("Date: %s, %04d-%02d-%02d\n", _wdays[_atp->t.tm_wday],
_atp->t.tm_year + 1900, _atp->t.tm_mon + 1, _atp->t.tm_mday);
@@ -490,17 +490,17 @@ int cpl_tr_print(cpl_tmrec_p _trp)
return -1;
}
printf("Recurrence definition\n-- start time ---\n");
- printf("Sys time: %d\n", (int)_trp->dtstart);
+ printf("Sys time: %llu\n", (unsigned long long)_trp->dtstart);
printf("Time: %02d:%02d:%02d\n", _trp->ts.tm_hour, _trp->ts.tm_min,
_trp->ts.tm_sec);
printf("Date: %s, %04d-%02d-%02d\n", _wdays[_trp->ts.tm_wday],
_trp->ts.tm_year + 1900, _trp->ts.tm_mon + 1, _trp->ts.tm_mday);
printf("---\n");
- printf("End time: %d\n", (int)_trp->dtend);
- printf("Duration: %d\n", (int)_trp->duration);
- printf("Until: %d\n", (int)_trp->until);
- printf("Freq: %d\n", (int)_trp->freq);
- printf("Interval: %d\n", (int)_trp->interval);
+ printf("End time: %llu\n", (unsigned long long)_trp->dtend);
+ printf("Duration: %llu\n", (unsigned long long)_trp->duration);
+ printf("Until: %llu\n", (unsigned long long)_trp->until);
+ printf("Freq: %d\n", _trp->freq);
+ printf("Interval: %d\n", _trp->interval);
if(_trp->byday) {
printf("Byday: ");
for(i = 0; i < _trp->byday->nr; i++)
@@ -965,7 +965,7 @@ int cpl_check_tmrec(cpl_tmrec_p _trp, cpl_ac_tm_p _atp, cpl_tr_res_p
_tsw)
int cpl_check_freq_interval(cpl_tmrec_p _trp, cpl_ac_tm_p _atp)
{
- int _t0, _t1;
+ unsigned long long _t0, _t1;
struct tm _tm;
if(!_trp || !_atp)
return REC_ERR;
@@ -983,12 +983,12 @@ int cpl_check_freq_interval(cpl_tmrec_p _trp, cpl_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 = (unsigned long long)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 = (unsigned long long)mktime(&_tm);
if(_trp->freq == FREQ_DAILY)
return (((_t1 - _t0) / (24 * 3600)) % _trp->interval == 0)
? REC_MATCH