blobmsg: allow BLOBMSG_TYPE_UNSPEC attributes, treat them as null for JSON conversion
[project/libubox.git] / blobmsg_json.c
index f629d76..d4f6846 100644 (file)
@@ -228,6 +228,9 @@ static void blobmsg_format_element(struct strbuf *s, struct blob_attr *attr, boo
 
        data_str = buf;
        switch(blob_id(attr)) {
+       case BLOBMSG_TYPE_UNSPEC:
+               sprintf(buf, "null");
+               break;
        case BLOBMSG_TYPE_BOOL:
                sprintf(buf, "%s", *(uint8_t *)data ? "true" : "false");
                break;