Eliminate localtime calls, various cleanups

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@723 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2003-03-31 03:19:34 +00:00
parent e6918cb42e
commit 9baba73625
11 changed files with 91 additions and 100 deletions

View File

@@ -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);