diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-07-21 03:24:01 +0400 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-07-21 03:24:01 +0400 |
commit | f3977836afc82ce32c203173bd393789e05a123e (patch) | |
tree | 62ccf4e3189987cb8e07cdc0833befbf53675c22 /blobmsg.h | |
parent | bd388d2b6c2c151bf513c1e449417d18ce02d10b (diff) |
blobmsg: add a helper function to reset the name of a blobmsg attribute
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'blobmsg.h')
-rw-r--r-- | blobmsg.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -51,6 +51,12 @@ static inline int blobmsg_hdrlen(unsigned int namelen) return BLOBMSG_PADDING(sizeof(struct blobmsg_hdr) + namelen + 1); } +static inline void blobmsg_clear_name(struct blob_attr *attr) +{ + struct blobmsg_hdr *hdr = (struct blobmsg_hdr *) blob_data(attr); + hdr->name[0] = 0; +} + static inline const char *blobmsg_name(const struct blob_attr *attr) { struct blobmsg_hdr *hdr = (struct blobmsg_hdr *) blob_data(attr); |