From 2f40e49e058a82c84ee4d4fd7f752b05906d8595 Mon Sep 17 00:00:00 2001 From: Ray Lai Date: Sun, 18 Feb 2007 19:03:12 +0000 Subject: strlen(3) returns size_t. OK itojun@. --- lib/libc/net/getaddrinfo.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/libc/net/getaddrinfo.c') 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) { -- cgit v1.2.3