[sr-dev] git:master: tmrec(k): fix week-day handling.

Andreas Granig agranig at linguin.org
Mon Apr 16 16:49:15 CEST 2012


Module: sip-router
Branch: master
Commit: 5d03575bd73ee80e794a7f398973f84ceed63681
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5d03575bd73ee80e794a7f398973f84ceed63681

Author: Andreas Granig <agranig at sipwise.com>
Committer: Andreas Granig <agranig at sipwise.com>
Date:   Mon Apr 16 16:47:27 2012 +0200

tmrec(k): fix week-day handling.

- days of week need an offset of 1.

---

 modules/tmrec/period.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/tmrec/period.c b/modules/tmrec/period.c
index 317e7b2..c5e4407 100644
--- a/modules/tmrec/period.c
+++ b/modules/tmrec/period.c
@@ -69,7 +69,7 @@ static void get_time_vars(int time_vars[SCALE_MAX], time_t t) {
 	time_vars[SCALE_MONTH]  = tm.tm_mon + 1;
 	time_vars[SCALE_WEEK]   = (tm.tm_mday - 1 + (tm.tm_wday - tm.tm_mday + 1) % 7) / 7 + 1;
 	time_vars[SCALE_MDAY]   = tm.tm_mday;
-	time_vars[SCALE_WDAY]   = tm.tm_wday;
+	time_vars[SCALE_WDAY]   = tm.tm_wday + 1;
 	time_vars[SCALE_YDAY]   = tm.tm_yday + 1;
 	time_vars[SCALE_HOUR]   = tm.tm_hour;
 	time_vars[SCALE_MINUTE] = tm.tm_min;




More information about the sr-dev mailing list