Browse Source

fix json_object_get_boolean() to behave like documented: must return true for objects and arrays

pull/659/head
Lukas Zeller 5 years ago
parent
commit
b68d2e0c1d
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      json_object.c

+ 2
- 1
json_object.c View File

@@ -702,7 +702,8 @@ json_bool json_object_get_boolean(const struct json_object *jso)
}
case json_type_double: return (JC_DOUBLE_C(jso)->c_double != 0);
case json_type_string: return (JC_STRING_C(jso)->len != 0);
default: return 0;
case json_type_null: return 0;
default: return 1;
}
}



Loading…
Cancel
Save