X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/blobdiff_plain/3b358a0e63668b706f7322e637b16b44129f7638..6e879cb4343d30c40e68bb095c3477be2fe272ad:/radix.c diff --git a/radix.c b/radix.c index 94e3dc70..019d7a3f 100644 --- a/radix.c +++ b/radix.c @@ -26,7 +26,7 @@ #include "includes.h" #include "uuencode.h" -RCSID("$OpenBSD: radix.c,v 1.18 2002/04/20 09:17:19 markus Exp $"); +RCSID("$OpenBSD: radix.c,v 1.20 2002/04/23 12:58:26 markus Exp $"); #ifdef AFS #include @@ -65,8 +65,7 @@ creds_to_radix(CREDENTIALS *creds, u_char *buf, size_t buflen) buffer_put_short(&b, creds->kvno); /* 32 bit size + data */ - buffer_put_string(&b, creds->ticket_st.dat, - sizeof(creds->ticket_st.length)); + buffer_put_string(&b, creds->ticket_st.dat, creds->ticket_st.length); ret = uuencode(buffer_ptr(&b), buffer_len(&b), (char *)buf, buflen); @@ -76,15 +75,17 @@ creds_to_radix(CREDENTIALS *creds, u_char *buf, size_t buflen) #define GETSTRING(b, t, tlen) \ do { \ - int i; \ + int i, found = 0; \ for (i = 0; i < tlen; i++) { \ if (buffer_len(b) == 0) \ goto done; \ t[i] = buffer_get_char(b); \ - if (t[i] == '\0') \ + if (t[i] == '\0') { \ + found = 1; \ break; \ + } \ } \ - if (t[i] != '\0') \ + if (!found) \ goto done; \ } while(0)