summaryrefslogtreecommitdiff
path: root/lib/libc/net/getaddrinfo.c
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2007-02-18 19:03:12 +0000
committerRay Lai <ray@cvs.openbsd.org>2007-02-18 19:03:12 +0000
commit2f40e49e058a82c84ee4d4fd7f752b05906d8595 (patch)
tree2e1b80aa95cb318b2bcf62ee8f401687b13778b2 /lib/libc/net/getaddrinfo.c
parent53bbcbd78dd74ba9acc7a9e8eda6ae7ecf57a4b0 (diff)
strlen(3) returns size_t.
OK itojun@.
Diffstat (limited to 'lib/libc/net/getaddrinfo.c')
-rw-r--r--lib/libc/net/getaddrinfo.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c
index bf74bc9926f..21f2094bfdc 100644
--- a/lib/libc/net/getaddrinfo.c
+++ b/lib/libc/net/getaddrinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getaddrinfo.c,v 1.60 2007/02/17 20:56:38 ray Exp $ */
+/* $OpenBSD: getaddrinfo.c,v 1.61 2007/02/18 19:03:11 ray Exp $ */
/* $KAME: getaddrinfo.c,v 1.31 2000/08/31 17:36:43 itojun Exp $ */
/*
@@ -1040,6 +1040,8 @@ getanswer(const querybuf *answer, int anslen, const char *qname, int qtype,
}
if ((qtype == T_A || qtype == T_AAAA || qtype == T_ANY) &&
type == T_CNAME) {
+ size_t len;
+
n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf);
if ((n < 0) || !(*name_ok)(tbuf)) {
had_error++;
@@ -1047,14 +1049,14 @@ getanswer(const querybuf *answer, int anslen, const char *qname, int qtype,
}
cp += n;
/* Get canonical name. */
- n = strlen(tbuf) + 1; /* for the \0 */
- if (n > ep - bp || n >= MAXHOSTNAMELEN) {
+ len = strlen(tbuf) + 1; /* for the \0 */
+ if (len > ep - bp || len >= MAXHOSTNAMELEN) {
had_error++;
continue;
}
strlcpy(bp, tbuf, ep - bp);
canonname = bp;
- bp += n;
+ bp += len;
continue;
}
if (qtype == T_ANY) {