Module: kamailio
Branch: master
Commit: 8f1a8c50ff230a1fffdd6b376f172cabe9fe60e3
URL: 
https://github.com/kamailio/kamailio/commit/8f1a8c50ff230a1fffdd6b376f172cabe9fe60e3

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2025-04-29T09:23:07+02:00

core: utils/tmrec - decrement month for bymonth matching

- struct tm uses 0-11, comparing with 1-12 in the date format
- GH #4214

---

Modified: src/core/utils/tmrec.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/8f1a8c50ff230a1fffdd6b376f172cabe9fe60e3.diff
Patch: 
https://github.com/kamailio/kamailio/commit/8f1a8c50ff230a1fffdd6b376f172cabe9fe60e3.patch

---

diff --git a/src/core/utils/tmrec.c b/src/core/utils/tmrec.c
index 7cbe6153824..d609e136310 100644
--- a/src/core/utils/tmrec.c
+++ b/src/core/utils/tmrec.c
@@ -1118,7 +1118,8 @@ int check_byxxx(tmrec_t *_trp, ac_tm_t *_atp)
        if(_trp->bymonth) {
                for(i = 0; i < _trp->bymonth->nr; i++) {
                        if(_atp->t.tm_mon
-                                       == (_trp->bymonth->xxx[i] * 
_trp->bymonth->req[i] + 12)
+                                       == ((_trp->bymonth->xxx[i] - 1) * 
_trp->bymonth->req[i]
+                                                          + 12)
                                                           % 12)
                                break;
                }

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to