blob_attr_equal: un-inline, add pointer checks
[project/libubox.git] / blobmsg.c
index 570be4c..3079dca 100644 (file)
--- a/blobmsg.c
+++ b/blobmsg.c
@@ -89,7 +89,7 @@ int blobmsg_parse(const struct blobmsg_policy *policy, int policy_len,
                                return -1;
 
                        if (tb[i])
-                               return -1;
+                               continue;
 
                        if (strcmp(policy[i].name, (char *) hdr->name) != 0)
                                continue;
@@ -188,10 +188,6 @@ blobmsg_add_field(struct blob_buf *buf, int type, const char *name,
        struct blob_attr *attr;
        void *data_dest;
 
-       if (type == BLOBMSG_TYPE_ARRAY ||
-           type == BLOBMSG_TYPE_TABLE)
-               return -1;
-
        attr = blobmsg_new(buf, type, name, len, &data_dest);
        if (!attr)
                return -1;