projects
/
project
/
libubox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
blobmsg: allow BLOBMSG_TYPE_UNSPEC attributes, treat them as null for JSON conversion
[project/libubox.git]
/
blobmsg_json.c
diff --git
a/blobmsg_json.c
b/blobmsg_json.c
index f629d76edae032177f843675d93d21652f761ad7..d4f68465512b2fccc92c0c415049b4458ed947ee 100644
(file)
--- 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;