Module: kamailio
Branch: master
Commit: e638232ff51793d683868a4cc7beba8014fcba47
URL:
https://github.com/kamailio/kamailio/commit/e638232ff51793d683868a4cc7beba8…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-01-06T08:03:27+01:00
jansson: use JSON_INTEGER_IS_LONG_LONG macro for type of json integer field
---
Modified: src/modules/jansson/jansson_utils.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e638232ff51793d683868a4cc7beba8…
Patch:
https://github.com/kamailio/kamailio/commit/e638232ff51793d683868a4cc7beba8…
---
diff --git a/src/modules/jansson/jansson_utils.c b/src/modules/jansson/jansson_utils.c
index f7afa4980c1..813757030b0 100644
--- a/src/modules/jansson/jansson_utils.c
+++ b/src/modules/jansson/jansson_utils.c
@@ -109,6 +109,7 @@ int jansson_to_xval(sr_xval_t *val, char** freeme, json_t* v) {
val->v.s.s = value;
val->v.s.len = strlen(value);
}else if(json_is_integer(v)) {
+#if JSON_INTEGER_IS_LONG_LONG
long long value = json_integer_value(v);
if ((value > LONG_MAX) || (value < LONG_MIN)) {
char* svalue = NULL;
@@ -124,6 +125,10 @@ int jansson_to_xval(sr_xval_t *val, char** freeme, json_t* v) {
val->type = SR_XTYPE_LONG;
val->v.l = (long)value;
}
+#else
+ val->type = SR_XTYPE_LONG;
+ val->v.l = (long)json_integer_value(v);
+#endif
}else if(json_is_null(v)) {
val->type = SR_XTYPE_NULL;
}else {