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:
Felix Fietkau 2013-01-13 09:02:47 +01:00
parent 2f74dbad14
commit 4b5f278195
2 changed files with 5 additions and 1 deletions

View 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;