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:
authorPetr Štetiar <ynezz@true.cz>2019-12-10 13:53:23 +0300
committerPetr Štetiar <ynezz@true.cz>2019-12-25 12:31:58 +0300
commit4dfd24ed88c4d721d2b26d478b9ada86395d0554 (patch)
tree3a0267150972177356fdddf837a4348e60ddb5b8 /blobmsg.h
parent2df6d35e3299ecce7975502a007c1ca456f4b8bb (diff)
blobmsg: make blobmsg_len and blobmsg_data_len return unsigned value
One usually doesn't guard against negative length values in the code. Signed-off-by: Petr Štetiar <ynezz@true.cz>
Diffstat (limited to 'blobmsg.h')
-rw-r--r--blobmsg.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/blobmsg.h b/blobmsg.h
index b06ef59..0af0878 100644
--- a/blobmsg.h
+++ b/blobmsg.h
@@ -86,7 +86,7 @@ static inline void *blobmsg_data(const struct blob_attr *attr)
return data;
}
-static inline int blobmsg_data_len(const struct blob_attr *attr)
+static inline size_t blobmsg_data_len(const struct blob_attr *attr)
{
uint8_t *start, *end;
@@ -99,7 +99,7 @@ static inline int blobmsg_data_len(const struct blob_attr *attr)
return blob_len(attr) - (end - start);
}
-static inline int blobmsg_len(const struct blob_attr *attr)
+static inline size_t blobmsg_len(const struct blob_attr *attr)
{
return blobmsg_data_len(attr);
}