diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-04-09 01:34:12 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-04-09 01:34:12 +0800 |
commit | 600e79999475e13edd019bd868249146ab949fd2 (patch) | |
tree | 889d45335ef86af08bde81dedd454944445f3867 /camel/camel-mime-utils.c | |
parent | c357c638049b6a83ec05fa95f236818e8d0528e5 (diff) | |
download | gsoc2013-evolution-600e79999475e13edd019bd868249146ab949fd2.tar.gz gsoc2013-evolution-600e79999475e13edd019bd868249146ab949fd2.tar.zst gsoc2013-evolution-600e79999475e13edd019bd868249146ab949fd2.zip |
Don't count our filler when encoding our line-length octet.
2002-04-08 Jeffrey Stedfast <fejj@ximian.com>
* camel-mime-utils.c (uuencode_close): Don't count our filler when
encoding our line-length octet.
svn path=/trunk/; revision=16390
Diffstat (limited to 'camel/camel-mime-utils.c')
-rw-r--r-- | camel/camel-mime-utils.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c index beff671e96..328a6dfce3 100644 --- a/camel/camel-mime-utils.c +++ b/camel/camel-mime-utils.c @@ -427,13 +427,15 @@ uuencode_close (unsigned char *in, size_t len, unsigned char *out, unsigned char { register unsigned char *outptr, *bufptr; register guint32 saved; - int uulen, i; + int uulen, uufill, i; outptr = out; if (len > 0) outptr += uuencode_step (in, len, out, uubuf, state, save); + uufill = 0; + saved = *save; i = *state & 0xff; uulen = (*state >> 8) & 0xff; @@ -443,6 +445,7 @@ uuencode_close (unsigned char *in, size_t len, unsigned char *out, unsigned char if (i > 0) { while (i < 3) { saved <<= 8 | 0; + uufill++; i++; } @@ -468,7 +471,7 @@ uuencode_close (unsigned char *in, size_t len, unsigned char *out, unsigned char if (uulen > 0) { int cplen = ((uulen / 3) * 4); - *outptr++ = CAMEL_UUENCODE_CHAR (uulen & 0xff); + *outptr++ = CAMEL_UUENCODE_CHAR ((uulen - uufill) & 0xff); memcpy (outptr, uubuf, cplen); outptr += cplen; *outptr++ = '\n'; |