summaryrefslogtreecommitdiffstats
path: root/login-utils/login.c
diff options
context:
space:
mode:
Diffstat (limited to 'login-utils/login.c')
-rw-r--r--login-utils/login.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/login-utils/login.c b/login-utils/login.c
index ce112b54e..6b9d27e3e 100644
--- a/login-utils/login.c
+++ b/login-utils/login.c
@@ -1355,10 +1355,7 @@ int main(int argc, char **argv)
/* if the shell field has a space: treat it like a shell script */
if (strchr(pwd->pw_shell, ' ')) {
- buff = xmalloc(strlen(pwd->pw_shell) + 6);
-
- strcpy(buff, "exec ");
- strcat(buff, pwd->pw_shell);
+ xasprintf(&buff, "exec %s", pwd->pw_shell);
childArgv[childArgc++] = "/bin/sh";
childArgv[childArgc++] = "-sh";
childArgv[childArgc++] = "-c";