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-31 05:51:06 +0300
committerFelix Fietkau <nbd@openwrt.org>2011-01-31 05:51:06 +0300
commit7a0571a9ff9a9adfe7563db3067f7faf81c815a9 (patch)
treef1e30ad65faac262200df71aa28f4b8d1f1e1126 /blobmsg.h
parentcad5bea36d0271f291a88adbf58ef2ad50c6160a (diff)
blobmsg: constify and add more validation
Diffstat (limited to 'blobmsg.h')
-rw-r--r--blobmsg.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/blobmsg.h b/blobmsg.h
index 7c63dbf..e978235 100644
--- a/blobmsg.h
+++ b/blobmsg.h
@@ -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;