aboutsummaryrefslogtreecommitdiffstats
path: root/cdr/cdr_csv.c
diff options
context:
space:
mode:
Diffstat (limited to 'cdr/cdr_csv.c')
-rwxr-xr-xcdr/cdr_csv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cdr/cdr_csv.c b/cdr/cdr_csv.c
index da7b07edc..17170a990 100755
--- a/cdr/cdr_csv.c
+++ b/cdr/cdr_csv.c
@@ -107,7 +107,7 @@ static int append_int(char *buf, int s, int len)
static int append_date(char *buf, struct timeval tv, int len)
{
char tmp[80];
- struct tm *tm;
+ struct tm tm;
time_t t;
t = tv.tv_sec;
if (strlen(buf) > len - 3)
@@ -116,8 +116,8 @@ static int append_date(char *buf, struct timeval tv, int len)
strncat(buf, ",", len);
return 0;
}
- tm = localtime(&t);
- strftime(tmp, sizeof(tmp), DATE_FORMAT, tm);
+ localtime_r(&t,&tm);
+ strftime(tmp, sizeof(tmp), DATE_FORMAT, &tm);
return append_string(buf, tmp, len);
}