dect
/
asterisk
Archived
13
0
Fork 0

way back in July, in r.75706, a fix was made ot the strftime usages, which was good, but in this case, the check for a nil time was accidentally removed, and now it is restored, to keep timevals like '1969-12-31 17:00:00' from showing up in the cdrs. No idea what databases will do with this. No bugs filed as yet, but it felt like a bug.

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@107019 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
murf 2008-03-10 14:55:21 +00:00
parent a4ae0883c2
commit f96fee046b
1 changed files with 7 additions and 5 deletions

View File

@ -200,11 +200,13 @@ static void cdr_get_tv(struct timeval tv, const char *fmt, char *buf, int bufsiz
{
if (fmt == NULL) { /* raw mode */
snprintf(buf, bufsize, "%ld.%06ld", (long)tv.tv_sec, (long)tv.tv_usec);
} else {
struct ast_tm tm;
ast_localtime(&tv, &tm, NULL);
ast_strftime(buf, bufsize, fmt, &tm);
} else {
if (tv.tv_sec) {
struct ast_tm tm;
ast_localtime(&tv, &tm, NULL);
ast_strftime(buf, bufsize, fmt, &tm);
}
}
}