diff options
author | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-10 23:46:02 +0000 |
---|---|---|
committer | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-10 23:46:02 +0000 |
commit | 446a31b256d23385d9a021b2b1c20aff5b0a4c5a (patch) | |
tree | 769bc93d0b1165a9eab3bc68af70b8d5e4afc9a2 /main/cdr.c | |
parent | a2e77df994d411e6d3a7fc503905690791c6b298 (diff) |
Merged revisions 107019 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r107019 | murf | 2008-03-10 08:55:21 -0600 (Mon, 10 Mar 2008) | 1 line
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/branches/1.6.0@107289 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/cdr.c')
-rw-r--r-- | main/cdr.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/main/cdr.c b/main/cdr.c index 183252438..5b68e8fed 100644 --- a/main/cdr.c +++ b/main/cdr.c @@ -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); + } } } |