[sr-dev] git:4.2:a6048713: lib/srdb1: use 6 digits for db_double2str

Victor Seva linuxmaniac at torreviejawireless.org
Tue Jun 9 12:25:30 CEST 2015


Module: kamailio
Branch: 4.2
Commit: a6048713634238d77897aa2f507e2508c571e211
URL: https://github.com/kamailio/kamailio/commit/a6048713634238d77897aa2f507e2508c571e211

Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2015-06-09T12:24:41+02:00

lib/srdb1: use 6 digits for db_double2str

acc module was getting values rounded by this

(cherry picked from commit e1dcdf5a48cae9802c51c1d516d6fbc862855dcb)

---

Modified: lib/srdb1/db_ut.c

---

Diff:  https://github.com/kamailio/kamailio/commit/a6048713634238d77897aa2f507e2508c571e211.diff
Patch: https://github.com/kamailio/kamailio/commit/a6048713634238d77897aa2f507e2508c571e211.patch

---

diff --git a/lib/srdb1/db_ut.c b/lib/srdb1/db_ut.c
index 344e4c6..e810919 100644
--- a/lib/srdb1/db_ut.c
+++ b/lib/srdb1/db_ut.c
@@ -195,7 +195,7 @@ inline int db_double2str(double _v, char* _s, int* _l)
 		return -1;
 	}
 
-	ret = snprintf(_s, *_l, "%-10.2f", _v);
+	ret = snprintf(_s, *_l, "%-10.6f", _v);
 	if (ret < 0 || ret >= *_l) {
 		LM_ERR("Error in snprintf\n");
 		return -1;




More information about the sr-dev mailing list