Use execvp instead execv

execvp resolves the executable location using PATH
This commit is contained in:
madmaurice 2021-01-12 13:24:08 +01:00
parent 8ac3b8afe3
commit f3cd63c137

2
main.c
View file

@ -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;