projects
/
project
/
libubox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
aa5276d
)
blobmsg: fix dynamic string buffer length calculation
author
Felix Fietkau
<nbd@openwrt.org>
Sun, 6 Feb 2011 01:07:26 +0000
(
02:07
+0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Sun, 6 Feb 2011 01:07:26 +0000
(
02:07
+0100)
blobmsg.c
patch
|
blob
|
history
diff --git
a/blobmsg.c
b/blobmsg.c
index
ed7a880
..
a77f158
100644
(file)
--- a/
blobmsg.c
+++ b/
blobmsg.c
@@
-321,7
+321,7
@@
blobmsg_alloc_string_buffer(struct blob_buf *buf, const char *name, int maxlen)
return NULL;
data_dest = blobmsg_data(attr);
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;
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);
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
}
int