Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-01-13 12:02:47 +0400
committerFelix Fietkau <nbd@openwrt.org>2013-01-13 12:02:51 +0400
commit4b5f278195c4bda222759682a2f9167646d05c77 (patch)
tree575a04d480b7097d14f3690edb6ad068aee19123 /blobmsg_json.c
parent2f74dbad14b42c3a6687b093210b8604d0b235cd (diff)
blobmsg: allow BLOBMSG_TYPE_UNSPEC attributes, treat them as null for JSON conversion
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'blobmsg_json.c')
-rw-r--r--blobmsg_json.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/blobmsg_json.c b/blobmsg_json.c
index f629d76..d4f6846 100644
--- a/blobmsg_json.c
+++ b/blobmsg_json.c
@@ -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;