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>2011-01-29 20:00:40 +0300
committerFelix Fietkau <nbd@openwrt.org>2011-01-29 20:00:40 +0300
commit5129bc940168d080e9b3aa63ae0f92a531455b0e (patch)
tree3e3b81ce90924e58c200ea87cc23ba1656f540a1 /blobmsg.h
parent34b9f56464485dd1c899958b80fbfd18a76e7a2c (diff)
blobmsg: make arrays structually the same as tables - simplifies library user code
Diffstat (limited to 'blobmsg.h')
-rw-r--r--blobmsg.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/blobmsg.h b/blobmsg.h
index c64cedb..95732e3 100644
--- a/blobmsg.h
+++ b/blobmsg.h
@@ -35,7 +35,7 @@ enum blobmsg_type {
};
struct blobmsg_hdr {
- uint8_t namelen;
+ uint16_t namelen;
uint8_t name[];
} __packed;
@@ -58,7 +58,7 @@ static inline void *blobmsg_name(struct blob_attr *attr)
static inline void *blobmsg_data(struct blob_attr *attr)
{
struct blobmsg_hdr *hdr = blob_data(attr);
- return &hdr->name[blobmsg_hdrlen(hdr->namelen) - 1];
+ return (char *) hdr + blobmsg_hdrlen(hdr->namelen);
}
static inline int blobmsg_data_len(struct blob_attr *attr)