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

@@ -1223,10 +1223,10 @@ static int transmit_notify_request_with_callerid(struct mgcp_endpoint *p, char *
char tone2[256];
char *l, *n;
time_t t;
struct tm *tm;
struct tm tm;
time(&t);
tm = localtime(&t);
localtime_r(&t,&tm);
if (callerid)
strncpy(cid, callerid, sizeof(cid) - 1);
else
@@ -1244,7 +1244,7 @@ static int transmit_notify_request_with_callerid(struct mgcp_endpoint *p, char *
if (!l)
l = "";
snprintf(tone2, sizeof(tone2), "%s,L/ci(%02d/%02d/%02d/%02d,%s,%s)", tone,
tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, l, n);
tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, l, n);
strncpy(p->curtone, tone, sizeof(p->curtone) - 1);
reqprep(&resp, p, "RQNT");
add_header(&resp, "X", p->txident);