summaryrefslogtreecommitdiffstats
path: root/lib/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/buffer.c')
-rw-r--r--lib/buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/buffer.c b/lib/buffer.c
index b689549ed..ee9310100 100644
--- a/lib/buffer.c
+++ b/lib/buffer.c
@@ -148,7 +148,7 @@ buffer_add (struct buffer *b)
{
struct buffer_data *d;
- d = XMALLOC(MTYPE_BUFFER_DATA, offsetof(struct buffer_data, data[b->size]));
+ d = XMALLOC(MTYPE_BUFFER_DATA, offsetof(struct buffer_data, data) + b->size);
d->cp = d->sp = 0;
d->next = NULL;