diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2000-04-26 21:51:51 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2000-04-26 21:51:51 +0000 |
commit | dedabf5b72df422aaa14be23fb5f31ce03c27ea4 (patch) | |
tree | d7690c0237b9b81dfdc29e597333b3f2a793bac2 /usr.bin/ssh/uuencode.c | |
parent | 2dd23c23770ee72b2c221e1b8ddf74531cf67e15 (diff) |
add trailing =
Diffstat (limited to 'usr.bin/ssh/uuencode.c')
-rw-r--r-- | usr.bin/ssh/uuencode.c | 6 |
1 files changed, 5 insertions, 1 deletions
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) |