summaryrefslogtreecommitdiff
path: root/usr.bin/vi/common/api.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/vi/common/api.c')
-rw-r--r--usr.bin/vi/common/api.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/vi/common/api.c b/usr.bin/vi/common/api.c
index cef2dd94057..bf90d1c717e 100644
--- a/usr.bin/vi/common/api.c
+++ b/usr.bin/vi/common/api.c
@@ -398,7 +398,7 @@ api_opts_get(sp, name, value)
switch (op->type) {
case OPT_0BOOL:
case OPT_1BOOL:
- MALLOC_RET(sp, *value, char *, strlen(op->name) + 2);
+ MALLOC_RET(sp, *value, char *, strlen(op->name) + 2 + 1);
(void)sprintf(*value,
"%s%s", O_ISSET(sp, offset) ? "" : "no", op->name);
break;
@@ -412,7 +412,7 @@ api_opts_get(sp, name, value)
value[0] = '\0';
} else {
MALLOC_RET(sp,
- *value, char *, strlen(O_STR(sp, offset)));
+ *value, char *, strlen(O_STR(sp, offset)) + 1);
(void)sprintf(*value, "%s", O_STR(sp, offset));
}
break;