aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-12-13 16:06:27 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-12-13 16:06:27 +0000
commit8b0389689d31a137314a4c0171b8aba73990c89d (patch)
tree7d6d3fc689efdba0423948027f82040895b33f6d
parent638e7e29d95ed2039735f114d7599df77f62719b (diff)
correct broken math in tvfix() for timestamp values over one million
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@7468 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils.c b/utils.c
index 89fc26211..f10441050 100644
--- a/utils.c
+++ b/utils.c
@@ -613,11 +613,11 @@ static struct timeval tvfix(struct timeval a)
if (a.tv_usec >= ONE_MILLION) {
ast_log(LOG_WARNING, "warning too large timestamp %ld.%ld\n",
a.tv_sec, (long int) a.tv_usec);
- a.tv_sec += a.tv_usec % ONE_MILLION;
+ a.tv_sec += a.tv_usec / ONE_MILLION;
a.tv_usec %= ONE_MILLION;
} else if (a.tv_usec < 0) {
ast_log(LOG_WARNING, "warning negative timestamp %ld.%ld\n",
- a.tv_sec, (long int) a.tv_usec);
+ a.tv_sec, (long int) a.tv_usec);
a.tv_usec = 0;
}
return a;