diff options
author | lebel <lebel@cvs.openbsd.org> | 2001-06-27 00:58:58 +0000 |
---|---|---|
committer | lebel <lebel@cvs.openbsd.org> | 2001-06-27 00:58:58 +0000 |
commit | 8af9ac2691950c45385aecf7c502a16c3c11db86 (patch) | |
tree | 2b4161da48e1261faa9895ae08bd1fcdf3be38a3 /lib/libc/yp | |
parent | c5355883f033c52fa97b73febb89e80adf21cbbd (diff) |
use strlcpy vs strncpy+a[len-1]='\0'. millert@ ok.
Diffstat (limited to 'lib/libc/yp')
-rw-r--r-- | lib/libc/yp/yp_bind.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libc/yp/yp_bind.c b/lib/libc/yp/yp_bind.c index 47cf920737b..c0a84b30e4a 100644 --- a/lib/libc/yp/yp_bind.c +++ b/lib/libc/yp/yp_bind.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: yp_bind.c,v 1.10 1999/08/17 09:13:13 millert Exp $"; +static char *rcsid = "$OpenBSD: yp_bind.c,v 1.11 2001/06/27 00:58:57 lebel Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -226,8 +226,7 @@ gotdata: sizeof(ysd->dom_server_addr.sin_addr.s_addr)); ysd->dom_server_port = ysd->dom_server_addr.sin_port; ysd->dom_vers = YPVERS; - (void)strncpy(ysd->dom_domain, dom, sizeof ysd->dom_domain-1); - ysd->dom_domain[sizeof ysd->dom_domain-1] = '\0'; + strlcpy(ysd->dom_domain, dom, sizeof ysd->dom_domain); } tv.tv_sec = _yplib_timeout / 2; tv.tv_usec = 0; |