aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-04-09 01:34:12 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-04-09 01:34:12 +0800
commit600e79999475e13edd019bd868249146ab949fd2 (patch)
tree889d45335ef86af08bde81dedd454944445f3867
parentc357c638049b6a83ec05fa95f236818e8d0528e5 (diff)
downloadgsoc2013-evolution-600e79999475e13edd019bd868249146ab949fd2.tar
gsoc2013-evolution-600e79999475e13edd019bd868249146ab949fd2.tar.gz
gsoc2013-evolution-600e79999475e13edd019bd868249146ab949fd2.tar.bz2
gsoc2013-evolution-600e79999475e13edd019bd868249146ab949fd2.tar.lz
gsoc2013-evolution-600e79999475e13edd019bd868249146ab949fd2.tar.xz
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
-rw-r--r--camel/ChangeLog5
-rw-r--r--camel/camel-mime-utils.c7
-rw-r--r--camel/camel-mime-utils.h4
3 files changed, 12 insertions, 4 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 2441aa6d1b..e6fc009227 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,8 @@
+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.
+
2002-04-05 Jeffrey Stedfast <fejj@ximian.com>
* camel-http-stream.c (http_get_headers): Don't get the statuscode
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';
diff --git a/camel/camel-mime-utils.h b/camel/camel-mime-utils.h
index 2c29f5cc43..91d1d71553 100644
--- a/camel/camel-mime-utils.h
+++ b/camel/camel-mime-utils.h
@@ -152,8 +152,8 @@ char *header_content_encoding_decode(const char *in);
/* raw headers */
void header_raw_append(struct _header_raw **list, const char *name, const char *value, int offset);
void header_raw_append_parse(struct _header_raw **list, const char *header, int offset);
-const char *header_raw_find(struct _header_raw **list, const char *name, int *ofset);
-const char *header_raw_find_next(struct _header_raw **list, const char *name, int *ofset, const char *last);
+const char *header_raw_find(struct _header_raw **list, const char *name, int *offset);
+const char *header_raw_find_next(struct _header_raw **list, const char *name, int *offset, const char *last);
void header_raw_replace(struct _header_raw **list, const char *name, const char *value, int offset);
void header_raw_remove(struct _header_raw **list, const char *name);
void header_raw_fold(struct _header_raw **list);