projects
/
oweals
/
libubox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bd388d2
)
blobmsg: add a helper function to reset the name of a blobmsg attribute
author
Felix Fietkau
<nbd@openwrt.org>
Sun, 20 Jul 2014 23:24:01 +0000
(
01:24
+0200)
committer
Felix Fietkau
<nbd@openwrt.org>
Sun, 20 Jul 2014 23:24:01 +0000
(
01:24
+0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
blobmsg.h
patch
|
blob
|
history
diff --git
a/blobmsg.h
b/blobmsg.h
index 082980a33c812f9ee2bcd6cd216bb090ade40d17..7041aca229e38c5285a4832c59d22efd9a9f6fdc 100644
(file)
--- a/
blobmsg.h
+++ b/
blobmsg.h
@@
-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);