diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 1997-11-29 14:09:17 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 1997-11-29 14:09:17 +0000 |
commit | 686ce037053e259327cfc1ce0d4b6d87282c55ec (patch) | |
tree | d93c265ba3b70a05c9f5833073e487a4475912a2 /kerberosIV/kerberos | |
parent | 7d7f0c7bb1d96c3884a613b413cf0f3cb260ad4c (diff) |
min/max-problem contiued.
Diffstat (limited to 'kerberosIV/kerberos')
-rw-r--r-- | kerberosIV/kerberos/kerberos.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/kerberosIV/kerberos/kerberos.c b/kerberosIV/kerberos/kerberos.c index 7f66aa55e65..70acb9f75a0 100644 --- a/kerberosIV/kerberos/kerberos.c +++ b/kerberosIV/kerberos/kerberos.c @@ -69,6 +69,14 @@ static int max_age = -1; static int pause_int = -1; static char progname[]="kerberos"; +#ifndef MAX +#define MAX(a,b) (((a)>(b))?(a):(b)) +#endif /* MAX */ + +#ifndef MIN +#define MIN(a,b) (((a)<(b))?(a):(b)) +#endif /* MIN */ + /* * Print usage message and exit. */ @@ -273,8 +281,8 @@ kerberos(unsigned char *buf, int len, strcpy((char*)rpkt->dat, krb_get_err_text(err)); return err; } - life = min(life, s_name.max_life); - life = min(life, a_name.max_life); + life = MIN(life, s_name.max_life); + life = MIN(life, a_name.max_life); des_new_random_key(&session); copy_to_key(&s_name.key_low, &s_name.key_high, key); @@ -353,11 +361,11 @@ kerberos(unsigned char *buf, int len, strcpy((char*)rpkt->dat, krb_get_err_text(err)); return err; } - life = min(life, + life = MIN(life, krb_time_to_life(kerb_time.tv_sec, krb_life_to_time(ad.time_sec, ad.life))); - life = min(life, s_name.max_life); + life = MIN(life, s_name.max_life); copy_to_key(&s_name.key_low, &s_name.key_high, key); unseal(&key); des_new_random_key(&session); @@ -906,7 +914,7 @@ loop(struct descr *fds, int nfds) continue; } FD_SET(n->s, &readfds); - maxfd = max(maxfd, n->s); + maxfd = MAX(maxfd, n->s); } /* add more space for sockets */ if(minfree == NULL){ |