From 779ea4dafdf5cdbd3b0cf2bd36c1e6070a18ad39 Mon Sep 17 00:00:00 2001 From: "Timothy B. Terriberry" <tterribe@xiph.org> Date: Tue, 3 Sep 2013 14:59:26 -0700 Subject: [PATCH] Fix a parentheses error in op_utf8_to_utf16(). For many Latin1 characters this still worked correctly by pure luck. Unfortunately, that included my test case. --- src/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream.c b/src/stream.c index 8bcdf00..4040a01 100644 --- a/src/stream.c +++ b/src/stream.c @@ -162,7 +162,7 @@ static wchar_t *op_utf8_to_utf16(const char *_src){ if((c0&0xE0)==0xC0){ wchar_t w; /*Start byte says this is a 2-byte sequence.*/ - w=c0&0x1F<<6|c1&0x3F; + w=(c0&0x1F)<<6|c1&0x3F; if(w>=0x80U){ /*This is a 2-byte sequence that is not overlong.*/ dst[di++]=w; -- GitLab