aboutsummaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/init.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/init/init.c b/init/init.c
index e4812538d..8b68a0556 100644
--- a/init/init.c
+++ b/init/init.c
@@ -579,9 +579,7 @@ static pid_t run(struct init_action *a)
if (strpbrk(a->command, "~`!$^&*()=|\\{}[];\"'<>?") != NULL) {
cmd[0] = SHELL;
cmd[1] = "-c";
- strcpy(buf, "exec ");
- safe_strncpy(buf + sizeof("exec "), a->command,
- sizeof(buf) - sizeof("exec "));
+ snprintf(buf, sizeof(buf), "exec %s", a->command);
cmd[2] = buf;
cmd[3] = NULL;
} else {