summaryrefslogtreecommitdiffstats
path: root/src/textprop.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/textprop.c')
-rw-r--r--src/textprop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/textprop.c b/src/textprop.c
index f219b925fa..a976414290 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -695,7 +695,7 @@ prop_type_set(typval_T *argvars, int add)
semsg(_("E969: Property type %s already defined"), name);
return;
}
- prop = alloc_clear(sizeof(proptype_T) + STRLEN(name));
+ prop = alloc_clear(offsetof(proptype_T, pt_name) + STRLEN(name) + 1);
if (prop == NULL)
return;
STRCPY(prop->pt_name, name);