diff options
author | Mark Spencer <markster@digium.com> | 2003-03-31 03:19:34 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2003-03-31 03:19:34 +0000 |
commit | 9baba73625c08ec7230fcc62b9b72e78d7d513c0 (patch) | |
tree | 06b9e7ecdef28acd64e8fe5614020f23b743687f /callerid.c | |
parent | e6918cb42edd1edb1f4ead796042d95b6cd98f08 (diff) |
Eliminate localtime calls, various cleanups
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@723 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'callerid.c')
-rwxr-xr-x | callerid.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/callerid.c b/callerid.c index f1827b76b..d1a8545f4 100755 --- a/callerid.c +++ b/callerid.c @@ -324,19 +324,19 @@ void callerid_free(struct callerid_state *cid) static int callerid_genmsg(char *msg, int size, char *number, char *name, int flags) { time_t t; - struct tm *tm; + struct tm tm; char *ptr; int res; int i,x; /* Get the time */ time(&t); - tm = localtime(&t); + localtime_r(&t,&tm); ptr = msg; /* Format time and message header */ - res = snprintf(ptr, size, "\001\010%02d%02d%02d%02d", tm->tm_mon + 1, - tm->tm_mday, tm->tm_hour, tm->tm_min); + res = snprintf(ptr, size, "\001\010%02d%02d%02d%02d", tm.tm_mon + 1, + tm.tm_mday, tm.tm_hour, tm.tm_min); size -= res; ptr += res; if (!number || !strlen(number) || (flags & CID_UNKNOWN_NUMBER)) { |