From ea56e463282c6168f8ec0f7c5aff43302efc7234 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Mon, 28 Oct 2002 22:11:57 +0000 Subject: [PATCH] * 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 --- src/lib/krb5/os/ChangeLog | 6 ++++++ src/lib/krb5/os/localaddr.c | 10 +++------- 2 files changed, 9 insertions(+), 7 deletions(-) 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; } -- 2.26.2