diff options
author | ray <> | 2007-02-18 19:03:11 +0000 |
---|---|---|
committer | ray <> | 2007-02-18 19:03:11 +0000 |
commit | 4474f954bf448226bacd6b8f7906c23d4d85f092 (patch) | |
tree | 6fc4ebc5009789a1f49c1fad95345f9df9a0e763 | |
parent | 0c706b7d00bdcb6771bc25f051ec4cd5a47322bc (diff) | |
download | openbsd-4474f954bf448226bacd6b8f7906c23d4d85f092.tar.gz openbsd-4474f954bf448226bacd6b8f7906c23d4d85f092.tar.bz2 openbsd-4474f954bf448226bacd6b8f7906c23d4d85f092.zip |
strlen(3) returns size_t.
OK itojun@.
-rw-r--r-- | src/lib/libc/net/getaddrinfo.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/libc/net/getaddrinfo.c b/src/lib/libc/net/getaddrinfo.c index bf74bc9926..21f2094bfd 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.60 2007/02/17 20:56:38 ray Exp $ */ | 1 | /* $OpenBSD: getaddrinfo.c,v 1.61 2007/02/18 19:03:11 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 | /* |
@@ -1040,6 +1040,8 @@ getanswer(const querybuf *answer, int anslen, const char *qname, int qtype, | |||
1040 | } | 1040 | } |
1041 | if ((qtype == T_A || qtype == T_AAAA || qtype == T_ANY) && | 1041 | if ((qtype == T_A || qtype == T_AAAA || qtype == T_ANY) && |
1042 | type == T_CNAME) { | 1042 | type == T_CNAME) { |
1043 | size_t len; | ||
1044 | |||
1043 | n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf); | 1045 | n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf); |
1044 | if ((n < 0) || !(*name_ok)(tbuf)) { | 1046 | if ((n < 0) || !(*name_ok)(tbuf)) { |
1045 | had_error++; | 1047 | had_error++; |
@@ -1047,14 +1049,14 @@ getanswer(const querybuf *answer, int anslen, const char *qname, int qtype, | |||
1047 | } | 1049 | } |
1048 | cp += n; | 1050 | cp += n; |
1049 | /* Get canonical name. */ | 1051 | /* Get canonical name. */ |
1050 | n = strlen(tbuf) + 1; /* for the \0 */ | 1052 | len = strlen(tbuf) + 1; /* for the \0 */ |
1051 | if (n > ep - bp || n >= MAXHOSTNAMELEN) { | 1053 | if (len > ep - bp || len >= MAXHOSTNAMELEN) { |
1052 | had_error++; | 1054 | had_error++; |
1053 | continue; | 1055 | continue; |
1054 | } | 1056 | } |
1055 | strlcpy(bp, tbuf, ep - bp); | 1057 | strlcpy(bp, tbuf, ep - bp); |
1056 | canonname = bp; | 1058 | canonname = bp; |
1057 | bp += n; | 1059 | bp += len; |
1058 | continue; | 1060 | continue; |
1059 | } | 1061 | } |
1060 | if (qtype == T_ANY) { | 1062 | if (qtype == T_ANY) { |