[sr-dev] git:master:0125c1c8: jansson: Fix reverse logic for JSON boolean

Henning Westerholt henningw at users.noreply.github.com
Tue Feb 5 21:11:10 CET 2019


Module: kamailio
Branch: master
Commit: 0125c1c8d8c1179670def9dc4b3e66d6a8e58360
URL: https://github.com/kamailio/kamailio/commit/0125c1c8d8c1179670def9dc4b3e66d6a8e58360

Author: Alex Hermann <alex at hexla.nl>
Committer: Henning Westerholt <henningw at users.noreply.github.com>
Date: 2019-02-05T21:11:03+01:00

jansson: Fix reverse logic for JSON boolean

---

Modified: src/modules/jansson/jansson_utils.c

---

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

---

diff --git a/src/modules/jansson/jansson_utils.c b/src/modules/jansson/jansson_utils.c
index 29ffc306f6..ae2040bc7c 100644
--- a/src/modules/jansson/jansson_utils.c
+++ b/src/modules/jansson/jansson_utils.c
@@ -45,7 +45,7 @@ int jansson_to_val(pv_value_t* val, char** freeme, json_t* v) {
 		val->rs.len = strlen(value);
 		val->flags = PV_VAL_STR;
 	}else if(json_is_boolean(v)) {
-		val->ri = json_is_true(v) ? 0 : 1;
+		val->ri = json_is_true(v) ? 1 : 0;
 		val->flags = PV_TYPE_INT|PV_VAL_INT;
 	}else if(json_is_real(v)) {
 		char* value = NULL;




More information about the sr-dev mailing list