summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/logic/slbt_exec_ctx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/logic/slbt_exec_ctx.c b/src/logic/slbt_exec_ctx.c
index 5dd9d70..0af29ca 100644
--- a/src/logic/slbt_exec_ctx.c
+++ b/src/logic/slbt_exec_ctx.c
@@ -102,7 +102,7 @@ static struct slbt_exec_ctx_impl * slbt_exec_ctx_alloc(
if (!(args = malloc(size)))
return 0;
- size = sizeof(*ictx) + (argc+SLBT_ARGV_SPARE_PTRS)*sizeof(char *);
+ size = sizeof(*ictx) + (2*(argc+1)+SLBT_ARGV_SPARE_PTRS)*sizeof(char *);
if (!(ictx = calloc(1,size))) {
free(args);
@@ -136,6 +136,7 @@ int slbt_get_exec_ctx(
/* init with guard for later .lo check */
ch = ictx->args + strlen(".lo");
ictx->ctx.argv = ictx->buffer;
+ ictx->ctx.altv = &ictx->buffer[ictx->argc + 1];
/* <compiler> */
ictx->ctx.program = dctx->cctx->cargv[0];