aboutsummaryrefslogtreecommitdiff
path: root/libcpp/charset.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2009-05-03 12:59:26 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2009-05-03 12:59:26 +0100
commit9e322bc1a5bea706d6f48c15ccba1fc9a8841012 (patch)
tree1520bfcfc1cca9e314890ea375efe86771b5799e /libcpp/charset.c
parentaea88c05c9e0ffe0a2a4c595a71d023b581595aa (diff)
downloadgcc-9e322bc1a5bea706d6f48c15ccba1fc9a8841012.zip
gcc-9e322bc1a5bea706d6f48c15ccba1fc9a8841012.tar.gz
gcc-9e322bc1a5bea706d6f48c15ccba1fc9a8841012.tar.bz2
charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte UTF-8 sequences.
libcpp: * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte UTF-8 sequences. gcc/testsuite: * gcc.dg/cpp/utf8-5byte-1.c: New test. From-SVN: r147073
Diffstat (limited to 'libcpp/charset.c')
-rw-r--r--libcpp/charset.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcpp/charset.c b/libcpp/charset.c
index e743b1e..f1da426 100644
--- a/libcpp/charset.c
+++ b/libcpp/charset.c
@@ -169,7 +169,7 @@ static inline int
one_utf8_to_cppchar (const uchar **inbufp, size_t *inbytesleftp,
cppchar_t *cp)
{
- static const uchar masks[6] = { 0x7F, 0x1F, 0x0F, 0x07, 0x02, 0x01 };
+ static const uchar masks[6] = { 0x7F, 0x1F, 0x0F, 0x07, 0x03, 0x01 };
static const uchar patns[6] = { 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
cppchar_t c;