Message ID | d9adaf6e-9bf7-b73f-f123-e846ff5388b5@linaro.org |
---|---|
State | New |
Headers | show |
diff --git a/posix/execvpe.c b/posix/execvpe.c index bd535b1..96a12bf5 100644 --- a/posix/execvpe.c +++ b/posix/execvpe.c @@ -54,7 +54,7 @@ maybe_script_execute (const char *file, char *const argv[], char *const envp[]) new_argv[0] = (char *) _PATH_BSHELL; new_argv[1] = (char *) file; if (argc > 1) - memcpy (new_argv + 2, argv + 1, argc * sizeof(char *)); + memcpy (new_argv + 2, argv + 1, (argc - 1) * sizeof(char *)); else new_argv[2] = NULL;