From ce9a1568d11d3f93b5a1535067029e8262ca0a04 Mon Sep 17 00:00:00 2001 From: comex Date: Sat, 11 Apr 2015 23:18:35 -0400 Subject: More bugfixes thanks to him. --- darwin-bootstrap/posixspawn-hook.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'darwin-bootstrap/posixspawn-hook.c') diff --git a/darwin-bootstrap/posixspawn-hook.c b/darwin-bootstrap/posixspawn-hook.c index ee6a1cb..d2a79f4 100644 --- a/darwin-bootstrap/posixspawn-hook.c +++ b/darwin-bootstrap/posixspawn-hook.c @@ -241,14 +241,15 @@ static int hook_posix_spawn_generic(__typeof__(posix_spawn) *old, /* append if it isn't one of ours */ bool is_substitute = (next - p == sizeof(bl_dylib) - 1 && - !memcmp(next, bl_dylib, sizeof(bl_dylib) - 1)) || + !memcmp(p, bl_dylib, sizeof(bl_dylib) - 1)) || (next - p == sizeof(psh_dylib) - 1 && - !memcmp(next, psh_dylib, sizeof(psh_dylib) - 1)); + !memcmp(p, psh_dylib, sizeof(psh_dylib) - 1)); if (!is_substitute) { if (newp != newp_orig) *newp++ = ':'; memcpy(newp, p, next - p); newp += next - p; + *newp = '\0'; } if (!*next) break; -- cgit v1.2.3