mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
add a library of timeval manipulation functions, and change a large number of usses to use the new functions (bug #4504)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -123,7 +123,7 @@ static int append_date(char *buf, struct timeval tv, size_t bufsize)
|
||||
t = tv.tv_sec;
|
||||
if (strlen(buf) > bufsize - 3)
|
||||
return -1;
|
||||
if (!tv.tv_sec && !tv.tv_usec) {
|
||||
if (ast_tvzero(tv)) {
|
||||
strncat(buf, ",", bufsize - strlen(buf) - 1);
|
||||
return 0;
|
||||
}
|
||||
|
@@ -372,7 +372,7 @@ static void get_date(char *dateField, struct timeval tv)
|
||||
char buf[80];
|
||||
|
||||
/* To make sure we have date variable if not insert null to SQL */
|
||||
if (tv.tv_sec && tv.tv_usec)
|
||||
if (!ast_tvzero(tv))
|
||||
{
|
||||
t = tv.tv_sec;
|
||||
localtime_r(&t, &tm);
|
||||
|
Reference in New Issue
Block a user