###Bug###
Bug
This line:
argv_copy[argc] = (char *) NULL;
should be:
argv_copy[argc-1] = NULL;
You are removing one argument so you need to terminate the array at the right place.
###Copy unneeded###
Copy unneeded
Instead of:
execvp(argv[1], argv_copy);
you could do:
execvp(argv[1], &argv[1]);
and avoid making a copy.
###Bug###
This line:
argv_copy[argc] = (char *) NULL;
should be:
argv_copy[argc-1] = NULL;
You are removing one argument so you need to terminate the array at the right place.
###Copy unneeded###
Instead of:
execvp(argv[1], argv_copy);
you could do:
execvp(argv[1], &argv[1]);
and avoid making a copy.
Bug
This line:
argv_copy[argc] = (char *) NULL;
should be:
argv_copy[argc-1] = NULL;
You are removing one argument so you need to terminate the array at the right place.
Copy unneeded
Instead of:
execvp(argv[1], argv_copy);
you could do:
execvp(argv[1], &argv[1]);
and avoid making a copy.
###Bug###
This line:
argv_copy[argc] = (char *) NULL;
should be:
argv_copy[argc-1] = NULL;
You are removing one argument so you need to terminate the array at the right place.
###Copy unneeded###
Instead of:
execvp(argv[1], argv_copy);
you could do:
execvp(argv[1], &argv[1]);
and avoid making a copy.