summaryrefslogtreecommitdiff
path: root/kerberosIV/krb/getaddrs.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>1997-11-29 14:07:11 +0000
committerArtur Grabowski <art@cvs.openbsd.org>1997-11-29 14:07:11 +0000
commit7d7f0c7bb1d96c3884a613b413cf0f3cb260ad4c (patch)
treee01024b33650ac6d1a28b99a5c5050a392f6f63a /kerberosIV/krb/getaddrs.c
parente491b11e001d251c278f33e67670a3c4bfab21c6 (diff)
fixed the min problem.
Diffstat (limited to 'kerberosIV/krb/getaddrs.c')
-rw-r--r--kerberosIV/krb/getaddrs.c10
1 files changed, 9 insertions, 1 deletions
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 <net/if.h>
#include <sys/sockio.h>
+#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) {