summaryrefslogtreecommitdiff
path: root/src/logic
diff options
context:
space:
mode:
Diffstat (limited to 'src/logic')
-rw-r--r--src/logic/slbt_exec_ctx.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/logic/slbt_exec_ctx.c b/src/logic/slbt_exec_ctx.c
index 6bae3fd..fcab308 100644
--- a/src/logic/slbt_exec_ctx.c
+++ b/src/logic/slbt_exec_ctx.c
@@ -67,7 +67,7 @@ static struct slbt_exec_ctx_impl * slbt_exec_ctx_alloc(
/* clerical [worst-case] buffer size (guard, .libs, version) */
size = strlen(".lo") + sizeof('\0');
- size += 6 * (strlen(".libs/") + sizeof('\0'));
+ size += 8 * (strlen(".libs/") + sizeof('\0'));
size += 36 * (strlen(".0000") + sizeof('\0'));
/* buffer size (cargv, -Wc) */
@@ -87,6 +87,17 @@ static struct slbt_exec_ctx_impl * slbt_exec_ctx_alloc(
/* buffer size (.libs/%.o, pessimistic) */
size += argc * strlen(".libs/");
+ /* buffer size (linking) */
+ if (dctx->cctx->mode == SLBT_MODE_LINK)
+ size += strlen(dctx->cctx->settings.arprefix) + sizeof('\0')
+ + strlen(dctx->cctx->settings.arsuffix) + sizeof('\0')
+ + strlen(dctx->cctx->settings.dsoprefix) + sizeof('\0')
+ + strlen(dctx->cctx->settings.dsoprefix) + sizeof('\0')
+ + strlen(dctx->cctx->settings.exeprefix) + sizeof('\0')
+ + strlen(dctx->cctx->settings.exeprefix) + sizeof('\0')
+ + strlen(dctx->cctx->settings.impprefix) + sizeof('\0')
+ + strlen(dctx->cctx->settings.impprefix) + sizeof('\0');
+
/* alloc */
if (!(args = malloc(size)))
return 0;