X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=blobmsg_json.c;h=96bfe28936d5f686d9712aae9d050fba9ae12785;hb=08a4bf2a299de28b46f59fc3fa2661e5632c2967;hp=0539bd1654db79e2abd985b2862531f32a6bfc7d;hpb=ed9b5c986b06bc90017461f8d0b8f45937a79598;p=project%2Flibubox.git diff --git a/blobmsg_json.c b/blobmsg_json.c index 0539bd1..96bfe28 100644 --- a/blobmsg_json.c +++ b/blobmsg_json.c @@ -228,14 +228,17 @@ static void blobmsg_format_element(struct strbuf *s, struct blob_attr *attr, boo data_str = buf; switch(blob_id(attr)) { - case BLOBMSG_TYPE_INT8: + case BLOBMSG_TYPE_BOOL: sprintf(buf, "%s", *(uint8_t *)data ? "true" : "false"); break; + case BLOBMSG_TYPE_INT16: + sprintf(buf, "%d", be16_to_cpu(*(uint16_t *)data)); + break; case BLOBMSG_TYPE_INT32: - sprintf(buf, "%d", *(uint32_t *)data); + sprintf(buf, "%d", be32_to_cpu(*(uint32_t *)data)); break; case BLOBMSG_TYPE_INT64: - sprintf(buf, "%lld", (long long int) *(uint64_t *)data); + sprintf(buf, "%lld", (long long int) be64_to_cpu(*(uint64_t *)data)); break; case BLOBMSG_TYPE_STRING: blobmsg_format_string(s, data);