aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_sms.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-11 15:13:38 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-11 15:13:38 +0000
commita33362865299d4903e2f8a06b47a10ccfa241d80 (patch)
tree2448703f04044556b3beea76b57ecf63f15e2d16 /apps/app_sms.c
parent4b2180b9b12b669de710a6823cb29bc67ebcec1e (diff)
Merged revisions 107464 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r107464 | kpfleming | 2008-03-11 09:53:03 -0500 (Tue, 11 Mar 2008) | 2 lines fix various other problems found by gcc 4.3 ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@107466 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_sms.c')
-rw-r--r--apps/app_sms.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/app_sms.c b/apps/app_sms.c
index 717f710e4..2af6a2590 100644
--- a/apps/app_sms.c
+++ b/apps/app_sms.c
@@ -528,9 +528,10 @@ static void packdate(unsigned char *o, time_t w)
}
/*! \brief unpack a date and return */
-static time_t unpackdate(unsigned char *i)
+static struct timeval unpackdate(unsigned char *i)
{
- struct tm t;
+ struct ast_tm t;
+
t.tm_year = 100 + (i[0] & 0xF) * 10 + (i[0] >> 4);
t.tm_mon = (i[1] & 0xF) * 10 + (i[1] >> 4) - 1;
t.tm_mday = (i[2] & 0xF) * 10 + (i[2] >> 4);
@@ -542,6 +543,7 @@ static time_t unpackdate(unsigned char *i)
t.tm_min += 15 * ((i[6] & 0x7) * 10 + (i[6] >> 4));
else
t.tm_min -= 15 * ((i[6] & 0x7) * 10 + (i[6] >> 4));
+
return ast_mktime(&t, NULL);
}
@@ -1058,7 +1060,7 @@ static unsigned char sms_handleincoming (sms_t * h)
p += unpackaddress(h->oa, h->imsg + p);
h->pid = h->imsg[p++];
h->dcs = h->imsg[p++];
- h->scts.tv_sec = unpackdate(h->imsg + p);
+ h->scts = unpackdate(h->imsg + p);
p += 7;
p += unpacksms(h->dcs, h->imsg + p, h->udh, &h->udhl, h->ud, &h->udl, h->udhi);
h->rx = 1; /* received message */