Module: kamailio
Branch: master
Commit: 2c22664610de2a007bbb881fead5640048ed24ba
URL:
https://github.com/kamailio/kamailio/commit/2c22664610de2a007bbb881fead5640…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-10-31T20:48:45+01:00
lib/srutils: srjson - init number value for null, true and false
---
Modified: lib/srutils/srjson.c
---
Diff:
https://github.com/kamailio/kamailio/commit/2c22664610de2a007bbb881fead5640…
Patch:
https://github.com/kamailio/kamailio/commit/2c22664610de2a007bbb881fead5640…
---
diff --git a/lib/srutils/srjson.c b/lib/srutils/srjson.c
index fdaf87a..9c1bc8f 100644
--- a/lib/srutils/srjson.c
+++ b/lib/srutils/srjson.c
@@ -444,14 +444,17 @@ static const char *parse_value(srjson_doc_t *doc, srjson_t *item,
const char *va
return 0; /* Fail on null. */
if (!strncmp(value, "null", 4)) {
item->type = srjson_NULL;
+ item->valuedouble = 0;
return value + 4;
}
if (!strncmp(value, "false", 5)) {
item->type = srjson_False;
+ item->valuedouble = 0;
return value + 5;
}
if (!strncmp(value, "true", 4)) {
item->type = srjson_True;
+ item->valuedouble = 1;
return value + 4;
}
if (*value == '\"') {