diff options
| author | Xin LI <delphij@FreeBSD.org> | 2008-10-17 21:21:14 +0000 |
|---|---|---|
| committer | Xin LI <delphij@FreeBSD.org> | 2008-10-17 21:21:14 +0000 |
| commit | 0ea291e2216fc45053d4f2fdcf067f78af0cc4de (patch) | |
| tree | 12320fe97bf01eb2e86983f6662e0a61f3d8d27b /lib/libutil/logwtmp.c | |
| parent | 1c109628324a21013f22a67423cf39c7c1454ae1 (diff) | |
Notes
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 a7b84111a942..6ae01a7ecfe6 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; |
