[sr-dev] [kamailio/kamailio] dmq_usrloc: fix variable type mismatch (#838)

Soapnix notifications at github.com
Mon Oct 31 13:51:12 CET 2016


srjson_t *srjson_CreateNumber(srjson_doc_t *doc, double num) {
	srjson_t *item = srjson_New_Item(doc);
	if (item) {
		item->type = srjson_Number;
		item->valuedouble = num; // <-- here is correct value
		item->valueint = (int) num; // <-- here is shrinked value
	} return item;
}

Correct value '4294967295' (max unsigned int), shrinked value is '2147483647' (max int).
So we need receive double and put it into unsigned int.
Possible the srjson can't correct work with unsigned int and as solution is translate unsigned int through the double.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/838#issuecomment-257285627
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20161031/87e25086/attachment.html>


More information about the sr-dev mailing list