diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-01-29 20:00:40 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-01-29 20:00:40 +0300 |
commit | 5129bc940168d080e9b3aa63ae0f92a531455b0e (patch) | |
tree | 3e3b81ce90924e58c200ea87cc23ba1656f540a1 /blobmsg.h | |
parent | 34b9f56464485dd1c899958b80fbfd18a76e7a2c (diff) |
blobmsg: make arrays structually the same as tables - simplifies library user code
Diffstat (limited to 'blobmsg.h')
-rw-r--r-- | blobmsg.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) |