X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=blobmsg.h;h=c4bf10d404abb231fa34a88aa994e3a3e2a1eeab;hb=d01922625d21f97fcab757d0299586178333f1e0;hp=44f1f3b428f6e79fafcbdb9c3ee441b193b7ac3a;hpb=c360ec576c5a0fe85e6665d07a091264b714a399;p=project%2Flibubox.git diff --git a/blobmsg.h b/blobmsg.h index 44f1f3b..c4bf10d 100644 --- a/blobmsg.h +++ b/blobmsg.h @@ -180,7 +180,10 @@ static inline uint32_t blobmsg_get_u32(struct blob_attr *attr) static inline uint64_t blobmsg_get_u64(struct blob_attr *attr) { - return be64_to_cpu(*(uint64_t *) blobmsg_data(attr)); + uint32_t *ptr = blobmsg_data(attr); + uint64_t tmp = ((uint64_t) be32_to_cpu(ptr[0])) << 32; + tmp |= be32_to_cpu(ptr[1]); + return tmp; } static inline char *blobmsg_get_string(struct blob_attr *attr) @@ -189,6 +192,7 @@ static inline char *blobmsg_get_string(struct blob_attr *attr) } void *blobmsg_alloc_string_buffer(struct blob_buf *buf, const char *name, int maxlen); +void *blobmsg_realloc_string_buffer(struct blob_buf *buf, int maxlen); void blobmsg_add_string_buffer(struct blob_buf *buf); /* blobmsg to json formatting */