summaryrefslogtreecommitdiffstats
path: root/lib/libutil/logwtmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libutil/logwtmp.c')
-rw-r--r--lib/libutil/logwtmp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libutil/logwtmp.c b/lib/libutil/logwtmp.c
index a7b8411..6ae01a7 100644
--- a/lib/libutil/logwtmp.c
+++ b/lib/libutil/logwtmp.c
@@ -59,8 +59,7 @@ logwtmp(const char *line, const char *name, const char *host)
char fullhost[MAXHOSTNAMELEN];
int fd;
- strncpy(fullhost, host, sizeof(fullhost) - 1);
- fullhost[sizeof(fullhost) - 1] = '\0';
+ strlcpy(fullhost, host, sizeof(fullhost));
trimdomain(fullhost, UT_HOSTSIZE);
host = fullhost;
OpenPOWER on IntegriCloud