[sr-dev] git:5.1:26cfea05: jansson: Fix reverse logic for JSON boolean
Henning Westerholt
hw at kamailio.org
Tue Feb 5 21:29:08 CET 2019
Module: kamailio
Branch: 5.1
Commit: 26cfea05082fbd2c4236510397986ace2b495b0f
URL: https://github.com/kamailio/kamailio/commit/26cfea05082fbd2c4236510397986ace2b495b0f
Author: Alex Hermann <alex at hexla.nl>
Committer: Henning Westerholt <hw at kamailio.org>
Date: 2019-02-05T21:25:49+01:00
jansson: Fix reverse logic for JSON boolean
(cherry picked from commit 0125c1c8d8c1179670def9dc4b3e66d6a8e58360)
---
Modified: src/modules/jansson/jansson_utils.c
---
Diff: https://github.com/kamailio/kamailio/commit/26cfea05082fbd2c4236510397986ace2b495b0f.diff
Patch: https://github.com/kamailio/kamailio/commit/26cfea05082fbd2c4236510397986ace2b495b0f.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