diff options
author | delphij <delphij@FreeBSD.org> | 2008-10-17 21:21:14 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2008-10-17 21:21:14 +0000 |
commit | 767e2acdc70d46a3950466a91899ee6e591ec838 (patch) | |
tree | 12320fe97bf01eb2e86983f6662e0a61f3d8d27b /lib/libutil/logwtmp.c | |
parent | cbecb62bfe4d08b1c22267fd67b968fa8d80de73 (diff) | |
download | FreeBSD-src-767e2acdc70d46a3950466a91899ee6e591ec838.zip FreeBSD-src-767e2acdc70d46a3950466a91899ee6e591ec838.tar.gz |
Use strlcpy() when we mean it.
Diffstat (limited to 'lib/libutil/logwtmp.c')
-rw-r--r-- | lib/libutil/logwtmp.c | 3 |
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; |