From 767e2acdc70d46a3950466a91899ee6e591ec838 Mon Sep 17 00:00:00 2001 From: delphij Date: Fri, 17 Oct 2008 21:21:14 +0000 Subject: Use strlcpy() when we mean it. --- lib/libutil/logwtmp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/libutil/logwtmp.c') 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; -- cgit v1.1