From f8346b16ddfbceb28e93d6c4ace8f7fdb7868ff3 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Sun, 4 Sep 2016 10:15:20 +0100 Subject: Get rid of strcpy() using XtNewString() --- greeter/Login.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'greeter') 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"); } } -- cgit v1.2.3