diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-08-27 10:25:58 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-08-27 10:25:58 +0000 |
commit | 3c9fe3b70bb90c5ae8602e74372825e99ab24805 (patch) | |
tree | fdfe29adde8e0bf6c413479d2aad4d75634b376a /usr.sbin/rpc.lockd/procs.c | |
parent | 0f7e2904e911f96612afeafde7819fa1e4dc54cf (diff) |
strncpy correctly
Diffstat (limited to 'usr.sbin/rpc.lockd/procs.c')
-rw-r--r-- | usr.sbin/rpc.lockd/procs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/rpc.lockd/procs.c b/usr.sbin/rpc.lockd/procs.c index 54e5f814ceb..91a2a220cfe 100644 --- a/usr.sbin/rpc.lockd/procs.c +++ b/usr.sbin/rpc.lockd/procs.c @@ -64,7 +64,7 @@ static void log_from_addr(char *fun_name, struct svc_req *req) host = gethostbyaddr((char *)&(addr->sin_addr), addr->sin_len, AF_INET); if (host) { - strncpy(hostname_buf, host->h_name, sizeof(hostname_buf)); + strncpy(hostname_buf, host->h_name, sizeof(hostname_buf) -1); hostname_buf[sizeof(hostname_buf) -1] = '\0'; } else /* No hostname available - print raw address */ |