diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-03-31 03:19:34 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-03-31 03:19:34 +0000 |
commit | d53be73ebe9f97b545594f1c2db16926aaddf524 (patch) | |
tree | 06b9e7ecdef28acd64e8fe5614020f23b743687f /channels/chan_phone.c | |
parent | e0c466aa42beff5788490914ece124091e8a7da7 (diff) |
Eliminate localtime calls, various cleanups
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@723 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_phone.c')
-rwxr-xr-x | channels/chan_phone.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/channels/chan_phone.c b/channels/chan_phone.c index b8ce778f9..b0a54443a 100755 --- a/channels/chan_phone.c +++ b/channels/chan_phone.c @@ -146,18 +146,18 @@ static int phone_call(struct ast_channel *ast, char *dest, int timeout) PHONE_CID cid; time_t UtcTime; - struct tm *t; + struct tm tm; if (ast->callerid) { time(&UtcTime); - t = localtime(&UtcTime); + localtime_r(&UtcTime,&tm); - if(t != NULL) { - sprintf(cid.month, "%02d",(t->tm_mon + 1)); - sprintf(cid.day, "%02d", t->tm_mday); - sprintf(cid.hour, "%02d", t->tm_hour); - sprintf(cid.min, "%02d", t->tm_min); + if(&tm != NULL) { + sprintf(cid.month, "%02d",(tm.tm_mon + 1)); + sprintf(cid.day, "%02d", tm.tm_mday); + sprintf(cid.hour, "%02d", tm.tm_hour); + sprintf(cid.min, "%02d", tm.tm_min); } strcpy(cid.name, "Unknown"); sprintf(cid.number,"%s",ast->callerid); |