summaryrefslogtreecommitdiff
path: root/greeter
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@herrb.eu>2016-09-04 10:15:20 +0100
committerMatthieu Herrb <matthieu@herrb.eu>2016-09-04 10:15:20 +0100
commitf8346b16ddfbceb28e93d6c4ace8f7fdb7868ff3 (patch)
tree6ad4f70680129a92660502df207cf0dc4ead658b /greeter
parente572bb61cdc262c12260773ec4e43c15cded0410 (diff)
Get rid of strcpy() using XtNewString()
Diffstat (limited to 'greeter')
-rw-r--r--greeter/Login.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/greeter/Login.c b/greeter/Login.c
index 6a99050..400395f 100644
--- a/greeter/Login.c
+++ b/greeter/Login.c
@@ -1262,10 +1262,8 @@ SetSessionArgument (
XtFree (ctx->login.sessionArg);
ctx->login.sessionArg = NULL;
if (*num_params > 0) {
- ctx->login.sessionArg = XtMalloc (strlen (params[0]) + 1);
- if (ctx->login.sessionArg)
- strcpy (ctx->login.sessionArg, params[0]);
- else
+ ctx->login.sessionArg = XtNewString(params[0]);
+ if (ctx->login.sessionArg == NULL)
LogOutOfMem ("set session argument");
}
}