lib: json: Fix parsing of boolean values

Boolean values were being decoded using the descriptor type rather than
the value type.

Jira: ZEP-1607
Change-Id: I0c9324ee705af973ccf738e92785820c3a5fb692
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
This commit is contained in:
Leandro Pereira 2017-03-23 16:32:03 -07:00 committed by Anas Nashif
parent 4c7803b59f
commit 262365c727

View file

@ -449,9 +449,9 @@ static int decode_value(struct json_obj *obj,
descr->n_elements, field, val);
case JSON_TOK_FALSE:
case JSON_TOK_TRUE: {
bool *value = field;
bool *v = field;
*value = descr->type == JSON_TOK_TRUE;
*v = value->type == JSON_TOK_TRUE;
return 0;
}