diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-01-31 05:51:06 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-01-31 05:51:06 +0300 |
commit | 7a0571a9ff9a9adfe7563db3067f7faf81c815a9 (patch) | |
tree | f1e30ad65faac262200df71aa28f4b8d1f1e1126 /blobmsg.h | |
parent | cad5bea36d0271f291a88adbf58ef2ad50c6160a (diff) |
blobmsg: constify and add more validation
Diffstat (limited to 'blobmsg.h')
-rw-r--r-- | blobmsg.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -49,19 +49,19 @@ static inline int blobmsg_hdrlen(int namelen) return BLOBMSG_PADDING(sizeof(struct blobmsg_hdr) + namelen + 1); } -static inline char *blobmsg_name(struct blob_attr *attr) +static inline const char *blobmsg_name(const struct blob_attr *attr) { struct blobmsg_hdr *hdr = blob_data(attr); - return (char *) hdr->name; + return (const char *) hdr->name; } -static inline void *blobmsg_data(struct blob_attr *attr) +static inline void *blobmsg_data(const struct blob_attr *attr) { struct blobmsg_hdr *hdr = blob_data(attr); return (char *) hdr + blobmsg_hdrlen(hdr->namelen); } -static inline int blobmsg_data_len(struct blob_attr *attr) +static inline int blobmsg_data_len(const struct blob_attr *attr) { uint8_t *start, *end; |