aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Zucci <zucchi@src.gnome.org>2000-08-31 09:49:21 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-08-31 09:49:21 +0800
commit26f1d04d35245fa23b469f2629d9564701ef4182 (patch)
tree77579b75f5c9485fa1ad6628ec79399d8ea24a9e
parentdbe98bddd36330aaca54af847593d05742da3840 (diff)
downloadgsoc2013-evolution-26f1d04d35245fa23b469f2629d9564701ef4182.tar.gz
gsoc2013-evolution-26f1d04d35245fa23b469f2629d9564701ef4182.tar.zst
gsoc2013-evolution-26f1d04d35245fa23b469f2629d9564701ef4182.zip
(append_latin1): Do an additional mask for account for c's
undefined behaviour for sign extension whilst shifting right. svn path=/trunk/; revision=5129
-rw-r--r--camel/ChangeLog2
-rw-r--r--camel/camel-mime-utils.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index de5d145e77..6c587fe801 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -5,6 +5,8 @@
us-ascii. We just have to encode high chars into utf-8.
(header_decode_text): Call append_latin1 for appending unencoded
text segments.
+ (append_latin1): Do an additional mask for account for c's
+ undefined behaviour for sign extension whilst shifting right.
2000-08-30 Jeffrey Stedfast <fejj@helixcode.com>
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index 193d9d00c5..749c968279 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -927,7 +927,7 @@ append_latin1(GString *out, const char *in, int len)
c = (unsigned int)*in++;
len--;
if (c & 0x80) {
- out = g_string_append_c(out, 0xc0 | (c>>6)); /* 110000xx */
+ out = g_string_append_c(out, 0xc0 | ((c>>6) & 0x3)); /* 110000xx */
out = g_string_append_c(out, 0x80 | (c&0x3f)); /* 10xxxxxx */
} else {
out = g_string_append_c(out, c);