From 7d7f0c7bb1d96c3884a613b413cf0f3cb260ad4c Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Sat, 29 Nov 1997 14:07:11 +0000 Subject: fixed the min problem. --- kerberosIV/krb/getaddrs.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'kerberosIV/krb/getaddrs.c') diff --git a/kerberosIV/krb/getaddrs.c b/kerberosIV/krb/getaddrs.c index 9a45422b090..d58e2f67af5 100644 --- a/kerberosIV/krb/getaddrs.c +++ b/kerberosIV/krb/getaddrs.c @@ -44,6 +44,14 @@ #include #include +#ifndef MAX +#define MAX(a,b) (((a)>(b))?(a):(b)) +#endif /* MAX */ + +#ifndef MIN +#define MIN(a,b) (((a)<(b))?(a):(b)) +#endif /* MIN */ + /* * Return number and list of all local adresses. */ @@ -78,7 +86,7 @@ k_get_all_addrs (struct in_addr **l) for (p = ifconf.ifc_buf; p < ifconf.ifc_buf + ifconf.ifc_len;) { struct ifreq *ifr = (struct ifreq *)p; size_t sz = sizeof(*ifr); - sz = max(sz, sizeof(ifr->ifr_name) + ifr->ifr_addr.sa_len); + sz = MAX(sz, sizeof(ifr->ifr_name) + ifr->ifr_addr.sa_len); if(strncmp(ifreq.ifr_name, ifr->ifr_name, sizeof(ifr->ifr_name))) { if(ioctl(fd, SIOCGIFFLAGS, ifr) < 0) { -- cgit v1.2.3