diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-08 23:20:35 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-08 23:20:35 +0100 |
commit | 4cdee0ee4745a5bb44b9f2c95812cb4f1aea0a31 (patch) | |
tree | db2578248683f7fda1752943db464d596e0429ff /src/fastd.h | |
parent | 9cd196627bef8c208bf04b5be985cedc9cde23ae (diff) | |
download | fastd-4cdee0ee4745a5bb44b9f2c95812cb4f1aea0a31.tar fastd-4cdee0ee4745a5bb44b9f2c95812cb4f1aea0a31.zip |
Fix allocated buffer size in fastd_buffer_alloc()
Diffstat (limited to 'src/fastd.h')
-rw-r--r-- | src/fastd.h | 2 |
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 }; } |