One usually doesn't guard against negative length values in the code.
Signed-off-by: Petr Štetiar <ynezz@true.cz>
{
const struct blobmsg_hdr *hdr;
const char *data;
- int id, len;
+ size_t len;
+ int id;
if (blob_len(attr) < sizeof(struct blobmsg_hdr))
return false;
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;
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);
}