summaryrefslogtreecommitdiffstats
path: root/src/getchar.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/getchar.c')
-rw-r--r--src/getchar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/getchar.c b/src/getchar.c
index 4a3587c3f2..b0e72f58f2 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -232,7 +232,7 @@ add_buff(
len = MINIMAL_SIZE;
else
len = slen;
- p = alloc(sizeof(buffblock_T) + len);
+ p = alloc(offsetof(buffblock_T, b_str) + len + 1);
if (p == NULL)
return; /* no space, just forget it */
buf->bh_space = (int)(len - slen);