summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorray <>2007-05-12 21:38:14 +0000
committerray <>2007-05-12 21:38:14 +0000
commit2afb937f72a249a958cb80e23fbe4bf5b7b2d8d7 (patch)
treec04587cca74b6cde041531f73f85f6cc78a13ceb /src/lib
parentd09a5dfa6cae4c7b7f1bbcd8831a5c94faacec9e (diff)
downloadopenbsd-2afb937f72a249a958cb80e23fbe4bf5b7b2d8d7.tar.gz
openbsd-2afb937f72a249a958cb80e23fbe4bf5b7b2d8d7.tar.bz2
openbsd-2afb937f72a249a958cb80e23fbe4bf5b7b2d8d7.zip
Use size_t for strlen results.
OK moritz@.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libc/net/getaddrinfo.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/libc/net/getaddrinfo.c b/src/lib/libc/net/getaddrinfo.c
index 532b2ee2c8..3f8521cb31 100644
--- a/src/lib/libc/net/getaddrinfo.c
+++ b/src/lib/libc/net/getaddrinfo.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getaddrinfo.c,v 1.63 2007/05/12 16:18:06 ray Exp $ */ 1/* $OpenBSD: getaddrinfo.c,v 1.64 2007/05/12 21:38:14 ray Exp $ */
2/* $KAME: getaddrinfo.c,v 1.31 2000/08/31 17:36:43 itojun Exp $ */ 2/* $KAME: getaddrinfo.c,v 1.31 2000/08/31 17:36:43 itojun Exp $ */
3 3
4/* 4/*
@@ -1004,17 +1004,19 @@ getanswer(const querybuf *answer, int anslen, const char *qname, int qtype,
1004 } 1004 }
1005 cp += n + QFIXEDSZ; 1005 cp += n + QFIXEDSZ;
1006 if (qtype == T_A || qtype == T_AAAA || qtype == T_ANY) { 1006 if (qtype == T_A || qtype == T_AAAA || qtype == T_ANY) {
1007 size_t len;
1008
1007 /* res_send() has already verified that the query name is the 1009 /* res_send() has already verified that the query name is the
1008 * same as the one we sent; this just gets the expanded name 1010 * same as the one we sent; this just gets the expanded name
1009 * (i.e., with the succeeding search-domain tacked on). 1011 * (i.e., with the succeeding search-domain tacked on).
1010 */ 1012 */
1011 n = strlen(bp) + 1; /* for the \0 */ 1013 len = strlen(bp) + 1; /* for the \0 */
1012 if (n >= MAXHOSTNAMELEN) { 1014 if (len >= MAXHOSTNAMELEN) {
1013 h_errno = NO_RECOVERY; 1015 h_errno = NO_RECOVERY;
1014 return (NULL); 1016 return (NULL);
1015 } 1017 }
1016 canonname = bp; 1018 canonname = bp;
1017 bp += n; 1019 bp += len;
1018 /* The qname can be abbreviated, but h_name is now absolute. */ 1020 /* The qname can be abbreviated, but h_name is now absolute. */
1019 qname = canonname; 1021 qname = canonname;
1020 } 1022 }