summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau2024-12-19 10:26:18 +0000
committerFelix Fietkau2024-12-19 10:26:21 +0000
commit3868f47c8f6c6570e62a3cdf8a7f26ffb1a67e6a (patch)
treed9903578d95e13cff9ae282691bef73c9d838b14
parenteb9bcb64185ac155c02cc1a604692c4b00368324 (diff)
downloadlibubox-3868f47c8f6c6570e62a3cdf8a7f26ffb1a67e6a.tar.gz
blob: constify attr argument to blob_memdup
It is not modified, so it can be const Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--blob.c2
-rw-r--r--blob.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/blob.c b/blob.c
index 65adb13..abcc9f2 100644
--- a/blob.c
+++ b/blob.c
@@ -323,7 +323,7 @@ blob_attr_equal(const struct blob_attr *a1, const struct blob_attr *a2)
}
struct blob_attr *
-blob_memdup(struct blob_attr *attr)
+blob_memdup(const struct blob_attr *attr)
{
struct blob_attr *ret;
int size = blob_pad_len(attr);
diff --git a/blob.h b/blob.h
index 6d61876..13bc7cc 100644
--- a/blob.h
+++ b/blob.h
@@ -200,7 +200,7 @@ extern struct blob_attr *blob_put(struct blob_buf *buf, int id, const void *ptr,
extern bool blob_check_type(const void *ptr, unsigned int len, int type);
extern int blob_parse(struct blob_attr *attr, struct blob_attr **data, const struct blob_attr_info *info, int max);
extern int blob_parse_untrusted(struct blob_attr *attr, size_t attr_len, struct blob_attr **data, const struct blob_attr_info *info, int max);
-extern struct blob_attr *blob_memdup(struct blob_attr *attr);
+extern struct blob_attr *blob_memdup(const struct blob_attr *attr);
extern struct blob_attr *blob_put_raw(struct blob_buf *buf, const void *ptr, unsigned int len);
static inline struct blob_attr *