summaryrefslogtreecommitdiff
path: root/lib/libc/net/getaddrinfo.c
diff options
context:
space:
mode:
authorlebel <lebel@cvs.openbsd.org>2001-06-27 00:58:58 +0000
committerlebel <lebel@cvs.openbsd.org>2001-06-27 00:58:58 +0000
commit8af9ac2691950c45385aecf7c502a16c3c11db86 (patch)
tree2b4161da48e1261faa9895ae08bd1fcdf3be38a3 /lib/libc/net/getaddrinfo.c
parentc5355883f033c52fa97b73febb89e80adf21cbbd (diff)
use strlcpy vs strncpy+a[len-1]='\0'. millert@ ok.
Diffstat (limited to 'lib/libc/net/getaddrinfo.c')
-rw-r--r--lib/libc/net/getaddrinfo.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c
index 0a0b112589d..cc313c5c6ad 100644
--- a/lib/libc/net/getaddrinfo.c
+++ b/lib/libc/net/getaddrinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getaddrinfo.c,v 1.28 2001/06/11 10:05:58 itojun Exp $ */
+/* $OpenBSD: getaddrinfo.c,v 1.29 2001/06/27 00:58:54 lebel Exp $ */
/* $KAME: getaddrinfo.c,v 1.31 2000/08/31 17:36:43 itojun Exp $ */
/*
@@ -1797,8 +1797,7 @@ res_querydomainN(name, domain, target)
return (-1);
}
if (n > 0 && name[--n] == '.') {
- strncpy(nbuf, name, n);
- nbuf[n] = '\0';
+ strlcpy(nbuf, name, n + 1);
} else
longname = name;
} else {