From cae4bb51fe7ccc33458caca2edf230e0f98ba3a1 Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 19 Mar 2016 19:04:32 -0400 Subject: slbt_get_exec_ctx(): fix logic behind conditional string manipulation. --- src/logic/slbt_exec_ctx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/logic/slbt_exec_ctx.c') diff --git a/src/logic/slbt_exec_ctx.c b/src/logic/slbt_exec_ctx.c index 6e794f8..57e0c88 100644 --- a/src/logic/slbt_exec_ctx.c +++ b/src/logic/slbt_exec_ctx.c @@ -173,7 +173,8 @@ int slbt_get_exec_ctx( ch[-2] = '\0'; ch--; } else if (ictx->ctx.csrc) { - if ((ch = strrchr(ictx->ctx.lbasename,'.'))) { + if ((mark = strrchr(ictx->ctx.lbasename,'.'))) { + ch = mark; *++ch = 'o'; *++ch = '\0'; ch++; @@ -228,8 +229,8 @@ int slbt_get_exec_ctx( ictx->ctx.ltobjname = ch; strcpy(ch,ictx->ctx.aobjname); - if ((ch = strrchr(ch,'.'))) - ch += sprintf(ch,"%s",".lo") + if ((mark = strrchr(ch,'.'))) + ch = mark + sprintf(mark,"%s",".lo") + sizeof('\0'); } -- cgit v1.2.3