From: markus Date: Wed, 26 Apr 2000 21:51:50 +0000 (+0000) Subject: add trailing = X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0ed7b0bcba72441ba6e68bf6557e0aff32a72e31;p=openbsd add trailing = --- diff --git a/usr.bin/ssh/uuencode.c b/usr.bin/ssh/uuencode.c index 22cad305884..092d9ba63c2 100644 --- a/usr.bin/ssh/uuencode.c +++ b/usr.bin/ssh/uuencode.c @@ -40,6 +40,9 @@ uuencode(unsigned char *bufin, unsigned int nbytes, char *bufcoded) } else if (i == nbytes + 2) { outptr[-1] = '='; outptr[-2] = '='; + } else if (i == nbytes) { + debug("uuencode: i == nbytes"); + *(outptr++) = '='; } *outptr = '\0'; return (outptr - bufcoded); @@ -76,7 +79,8 @@ uudecode(const char *bufcoded, unsigned char *bufplain, int outbufsize) * buffer, adjust the number of input bytes downwards. */ bufin = bufcoded; - while (DEC(*(bufin++)) <= MAXVAL); + while (DEC(*(bufin++)) <= MAXVAL) + ; nprbytes = bufin - bufcoded - 1; nbytesdecoded = ((nprbytes + 3) / 4) * 3; if (nbytesdecoded > outbufsize)