summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-03-08 23:20:35 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-03-08 23:20:35 +0100
commit4cdee0ee4745a5bb44b9f2c95812cb4f1aea0a31 (patch)
treedb2578248683f7fda1752943db464d596e0429ff
parent9cd196627bef8c208bf04b5be985cedc9cde23ae (diff)
downloadfastd-4cdee0ee4745a5bb44b9f2c95812cb4f1aea0a31.tar
fastd-4cdee0ee4745a5bb44b9f2c95812cb4f1aea0a31.zip
Fix allocated buffer size in fastd_buffer_alloc()
-rw-r--r--src/fastd.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fastd.h b/src/fastd.h
index fa0fa98..806beb7 100644
--- a/src/fastd.h
+++ b/src/fastd.h
@@ -140,7 +140,7 @@ void fastd_printf(const fastd_context *ctx, const char *format, ...);
static inline fastd_buffer fastd_buffer_alloc(size_t len, size_t head_space, size_t tail_space) {
size_t base_len = head_space+len+tail_space;
- uint8_t *ptr = malloc(head_space+len);
+ uint8_t *ptr = malloc(base_len);
return (fastd_buffer){ .base = ptr, .base_len = base_len, .data = ptr+head_space, .len = len };
}