From f3cd63c13748c283c0f4dcbedd2d4828d8a9105d Mon Sep 17 00:00:00 2001 From: MadMaurice Date: Tue, 12 Jan 2021 13:24:08 +0100 Subject: [PATCH] Use execvp instead execv execvp resolves the executable location using PATH --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 12793bf..674e657 100644 --- a/main.c +++ b/main.c @@ -111,7 +111,7 @@ int main(int argc, const char** argv) char** newargs = argdup(argc-1, &argv[1]); - if (execv(newargs[0], newargs) == -1) + if (execvp(newargs[0], newargs) == -1) { printf("Failed to exec (%d)\n", errno); return errno;