diff --git a/src/programs/cp/cp.c b/src/programs/cp/cp.c index 6869ed1012..f322ce09eb 100644 --- a/src/programs/cp/cp.c +++ b/src/programs/cp/cp.c @@ -2,15 +2,16 @@ #include #include -#include +#include #include +#include int main(int argc, char *argv[]) { - const char *cp_path = "/bin/cp"; - const char *clone_arg = "-c"; - const char **new_argv = malloc(sizeof(char *) * (argc+2)); - if (new_argv) { + char *cp_path = strdup("/bin/cp"); + char *clone_arg = strdup("-c"); + char **new_argv = malloc(sizeof(char *) * (argc+2)); + if (cp_path && clone_arg && new_argv) { new_argv[0] = cp_path; new_argv[1] = clone_arg; for (int i = 1; i <= argc; i++) {