way back in July, in r.75706, a fix was made ot the strftime usages, which was good...
authorSteve Murphy <murf@digium.com>
Mon, 10 Mar 2008 14:55:21 +0000 (14:55 +0000)
committerSteve Murphy <murf@digium.com>
Mon, 10 Mar 2008 14:55:21 +0000 (14:55 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@107019 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/cdr.c

index 1832524..5b68e8f 100644 (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);
+               }
        }
 }