diff options
author | Not Zed <NotZed@Ximian.com> | 2002-07-19 19:25:02 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2002-07-19 19:25:02 +0800 |
commit | d4963655fe3ea009dc867d9dd69f45ff5602a2a5 (patch) | |
tree | cf1589ac9d5c19298ad6c77fcdd50fd9d60f219e /camel/camel-mime-part-utils.c | |
parent | 544e980df30a310b6ed29b5cd7e5616bf12e02a0 (diff) | |
download | gsoc2013-evolution-d4963655fe3ea009dc867d9dd69f45ff5602a2a5.tar gsoc2013-evolution-d4963655fe3ea009dc867d9dd69f45ff5602a2a5.tar.gz gsoc2013-evolution-d4963655fe3ea009dc867d9dd69f45ff5602a2a5.tar.bz2 gsoc2013-evolution-d4963655fe3ea009dc867d9dd69f45ff5602a2a5.tar.lz gsoc2013-evolution-d4963655fe3ea009dc867d9dd69f45ff5602a2a5.tar.xz gsoc2013-evolution-d4963655fe3ea009dc867d9dd69f45ff5602a2a5.tar.zst gsoc2013-evolution-d4963655fe3ea009dc867d9dd69f45ff5602a2a5.zip |
Changed to use a different length calculator.
2002-07-19 Not Zed <NotZed@Ximian.com>
* camel-mime-part-utils.c (convert_buffer): Changed to use a
different length calculator.
svn path=/trunk/; revision=17519
Diffstat (limited to 'camel/camel-mime-part-utils.c')
-rw-r--r-- | camel/camel-mime-part-utils.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/camel/camel-mime-part-utils.c b/camel/camel-mime-part-utils.c index a76de32f0d..bf4d434b34 100644 --- a/camel/camel-mime-part-utils.c +++ b/camel/camel-mime-part-utils.c @@ -51,7 +51,8 @@ #include "camel-html-parser.h" #include "camel-charset-map.h" -#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/ +#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x)) + #include <stdio.h>*/ /* example: <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> */ @@ -113,7 +114,9 @@ convert_buffer (GByteArray *in, const char *to, const char *from) if (in->len == 0) return g_byte_array_new(); - d(printf("converting buffer from %s to %s: '%.*s'\n", from, to, (int)in->len, in->data)); + d(printf("converting buffer from %s to %s:\n", from, to)); + d(fwrite(in->data, 1, (int)in->len, stdout)); + d(printf("\n")); cd = e_iconv_open(to, from); if (cd == (iconv_t) -1) { @@ -144,7 +147,7 @@ convert_buffer (GByteArray *in, const char *to, const char *from) * We just need to grow our outbuffer and try again. */ - converted = outlen - outleft; + converted = outbuf - (char *)out->data; if (errno == E2BIG) { outlen += inleft * 2 + 16; out = g_byte_array_set_size (out, outlen); @@ -164,9 +167,13 @@ convert_buffer (GByteArray *in, const char *to, const char *from) e_iconv (cd, NULL, NULL, &outbuf, &outleft); /* now set the true length on the GByteArray */ - converted = outlen - outleft; + converted = outbuf - (char *)out->data; g_byte_array_set_size (out, converted); - + + d(printf("converted data:\n")); + d(fwrite(out->data, 1, (int)out->len, stdout)); + d(printf("\n")); + e_iconv_close (cd); return out; |