summaryrefslogtreecommitdiff
path: root/greeter/greet.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2018-07-10 14:44:35 +0000
committerMatthieu Herrb <matthieu@herrb.eu>2020-07-14 15:52:40 +0200
commit73935283dea4c05c18e2ee2d3606e450d052c60c (patch)
treeb031ab44595042c6d71811ac432cdf4cf827a37d /greeter/greet.c
parent82550d3e45c4df951eb7fc669e6b2d55037cc629 (diff)
Get rid of strcpy and strncpy (they were all looking safe though)
Diffstat (limited to 'greeter/greet.c')
-rw-r--r--greeter/greet.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/greeter/greet.c b/greeter/greet.c
index 6f17175..3802bb3 100644
--- a/greeter/greet.c
+++ b/greeter/greet.c
@@ -101,10 +101,8 @@ GreetDone (
data->name, strlen (data->passwd));
switch (status) {
case NOTIFY_OK:
- strncpy (name, data->name, sizeof(name));
- name[sizeof(name)-1] = '\0';
- strncpy (password, data->passwd, sizeof(password));
- password[sizeof(password)-1] = '\0';
+ strlcpy (name, data->name, sizeof(name));
+ strlcpy (password, data->passwd, sizeof(password));
code = 0;
done = 1;
break;