blobmsg: allow BLOBMSG_TYPE_UNSPEC attributes, treat them as null for JSON conversion
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
parent
2f74dbad14
commit
4b5f278195
2 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue