[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openser-devel
Subject:    [sr-dev] git:master: modules_k/pv: Fix microsecond respresentation
From:       Alex Hermann <alex () speakup ! nl>
Date:       2010-12-28 14:29:39
Message-ID: 20101228142939.4BB3EEF807A () rimmer
[Download RAW message or body]

Module: sip-router
Branch: master
Commit: a4545d8d23d9de3c6cf18329a822b677d9527047
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a4545d8d23d9de3c6cf18329a822b677d9527047


Author: Alex Hermann <alex@speakup.nl>
Committer: Alex Hermann <alex@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

---

 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 0687f53..72ce234 100644
--- a/modules_k/pv/pv_time.c
+++ b/modules_k/pv/pv_time.c
@@ -300,7 +300,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);


_______________________________________________
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic