diff options
author | midipix <writeonce@midipix.org> | 2016-03-19 19:04:32 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-03-19 19:07:54 -0400 |
commit | cae4bb51fe7ccc33458caca2edf230e0f98ba3a1 (patch) | |
tree | 44a9ffaffa92e89c5ab85d6c710c090adb1343b4 | |
parent | 014f4cca59d94172de0120042207b15dbb01b788 (diff) | |
download | slibtool-cae4bb51fe7ccc33458caca2edf230e0f98ba3a1.tar.bz2 slibtool-cae4bb51fe7ccc33458caca2edf230e0f98ba3a1.tar.xz |
slbt_get_exec_ctx(): fix logic behind conditional string manipulation.
-rw-r--r-- | src/logic/slbt_exec_ctx.c | 7 |
1 files changed, 4 insertions, 3 deletions
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'); } |