[sr-dev] git:master:526873c7: jansson: Fix another case of inverse boolean logic

Henning Westerholt hw at skalatan.de
Thu Nov 19 07:54:07 CET 2020


Module: kamailio
Branch: master
Commit: 526873c70ac3860638107a74ac50ed6028319bc8
URL: https://github.com/kamailio/kamailio/commit/526873c70ac3860638107a74ac50ed6028319bc8

Author: Alex Hermann <alex at hexla.nl>
Committer: Henning Westerholt <hw at skalatan.de>
Date: 2020-11-19T07:54:01+01:00

jansson: Fix another case of inverse boolean logic

Copy-pasto from before the other fix.

---

Modified: src/modules/jansson/jansson_utils.c

---

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

---

diff --git a/src/modules/jansson/jansson_utils.c b/src/modules/jansson/jansson_utils.c
index 14b4b82c25..db1ab43b07 100644
--- a/src/modules/jansson/jansson_utils.c
+++ b/src/modules/jansson/jansson_utils.c
@@ -97,7 +97,7 @@ int jansson_to_xval(sr_xval_t *val, char** freeme, json_t* v) {
 		val->v.s.len = strlen(value);
 	}else if(json_is_boolean(v)) {
 		val->type = SR_XTYPE_INT;
-		val->v.i = json_is_true(v) ? 0 : 1;
+		val->v.i = json_is_true(v) ? 1 : 0;
 	}else if(json_is_real(v)) {
 		char* value = NULL;
 		if(asprintf(&value, "%.15g", json_real_value(v))<0) {




More information about the sr-dev mailing list