aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-utils.c
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 /camel/camel-mime-utils.c
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
Diffstat (limited to 'camel/camel-mime-utils.c')
-rw-r--r--camel/camel-mime-utils.c2
1 files changed, 1 insertions, 1 deletions
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);