From 0ed7b0bcba72441ba6e68bf6557e0aff32a72e31 Mon Sep 17 00:00:00 2001 From: markus Date: Wed, 26 Apr 2000 21:51:50 +0000 Subject: [PATCH] add trailing = --- usr.bin/ssh/uuencode.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) -- 2.20.1