diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-02-06 04:07:26 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-02-06 04:07:26 +0300 |
commit | 3bc18fcadc87a073de47ce94c10fc974104637be (patch) | |
tree | 5d81b93b3cf6fd70f39b5bcabce20e8a25afcb93 /blobmsg.c | |
parent | aa5276dcd6d6de05f45a5c83d32d711ab7db6bcf (diff) |
blobmsg: fix dynamic string buffer length calculation
Diffstat (limited to 'blobmsg.c')
-rw-r--r-- | blobmsg.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -321,7 +321,7 @@ blobmsg_alloc_string_buffer(struct blob_buf *buf, const char *name, int maxlen) return NULL; data_dest = blobmsg_data(attr); - blob_set_raw_len(buf->head, blob_pad_len(buf->head) - blob_raw_len(attr)); + blob_set_raw_len(buf->head, blob_pad_len(buf->head) - blob_pad_len(attr)); blob_set_raw_len(attr, blob_raw_len(attr) - maxlen); return data_dest; @@ -338,7 +338,7 @@ blobmsg_add_string_buffer(struct blob_buf *buf) attrlen = blob_raw_len(attr) + len; blob_set_raw_len(attr, attrlen); - blob_set_raw_len(buf->head, blob_raw_len(buf->head) + attrlen); + blob_set_raw_len(buf->head, blob_raw_len(buf->head) + blob_pad_len(attr)); } int |