Module: sip-router
Branch: 3.1
Commit: 3b1f81896b36cb98f3a98c2c63ca64f80bc2bd65
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3b1f818…
Author: Alex Hermann <alex(a)speakup.nl>
Committer: Alex Hermann <alex(a)speakup.nl>
Date: Tue Dec 28 13:44:53 2010 +0100
modules_k/pv: Fix microsecond respresentation of $TV(Sn)
Make sure <100000us isn't off by multiple powers of 10.
eg make sure 5us isn't printed as 0.5 sec by padding with 0's
(cherry picked from commit a4545d8d23d9de3c6cf18329a822b677d9527047)
---
modules_k/pv/pv_time.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/modules_k/pv/pv_time.c b/modules_k/pv/pv_time.c
index f904080..399170c 100644
--- a/modules_k/pv/pv_time.c
+++ b/modules_k/pv/pv_time.c
@@ -245,7 +245,7 @@ int pv_get_timeval(struct sip_msg *msg, pv_param_t *param,
LM_ERR("unable to get time val attributes\n");
return pv_get_null(msg, param, res);
}
- s.len = snprintf(_timeval_ts_buf, 32, "%u.%u",
+ s.len = snprintf(_timeval_ts_buf, 32, "%u.%06u",
(unsigned int)tv.tv_sec, (unsigned int)tv.tv_usec);
if(s.len<0)
return pv_get_null(msg, param, res);