From: Ken Raeburn Date: Mon, 28 Oct 2002 22:11:57 +0000 (+0000) Subject: * localaddr.c (print_addr) [TEST]: Don't mix size_t and socklen_t, just assume X-Git-Tag: krb5-1.3-alpha1~307 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ea56e463282c6168f8ec0f7c5aff43302efc7234;p=krb5.git * localaddr.c (print_addr) [TEST]: Don't mix size_t and socklen_t, just assume socklen macro will return a socklen_t value. Cast buffer size to socklen_t in getnameinfo call. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14944 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index 20edb2a40..1d1ed8bf9 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,9 @@ +2002-10-28 Ken Raeburn + + * localaddr.c (print_addr) [TEST]: Don't mix size_t and socklen_t, + just assume socklen macro will return a socklen_t value. Cast + buffer size to socklen_t in getnameinfo call. + 2002-10-22 Ezra Peisach * sendto_kdc.c (service_tcp_fd): If DEBUG defined, ensure that diff --git a/src/lib/krb5/os/localaddr.c b/src/lib/krb5/os/localaddr.c index 6a4f33725..a8b752d15 100644 --- a/src/lib/krb5/os/localaddr.c +++ b/src/lib/krb5/os/localaddr.c @@ -59,14 +59,10 @@ static int print_addr (/*@unused@*/ void *dataptr, struct sockaddr *sa) char hostbuf[NI_MAXHOST]; int err; socklen_t len; - size_t len_sz; printf (" --> family %2d ", sa->sa_family); - len_sz = socklen (sa); - len = (socklen_t) len_sz; - if ((size_t) len != len_sz) - abort (); - err = getnameinfo (sa, len, hostbuf, sizeof (hostbuf), + len = socklen (sa); + err = getnameinfo (sa, len, hostbuf, (socklen_t) sizeof (hostbuf), (char *) NULL, 0, NI_NUMERICHOST); if (err) printf ("\n", err, gai_strerror (err)); @@ -80,7 +76,7 @@ int main () int r; (void) setvbuf (stdout, (char *)NULL, _IONBF, 0); - r = foreach_localaddr (0, print_addr, 0, 0); + r = foreach_localaddr (0, print_addr, NULL, NULL); printf ("return value = %d\n", r); return 0; }