summaryrefslogtreecommitdiff
path: root/enc/emacs_mule.c
diff options
context:
space:
mode:
Diffstat (limited to 'enc/emacs_mule.c')
-rw-r--r--enc/emacs_mule.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/enc/emacs_mule.c b/enc/emacs_mule.c
index 9ebb44339a..e97bb6aedd 100644
--- a/enc/emacs_mule.c
+++ b/enc/emacs_mule.c
@@ -237,7 +237,6 @@ mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
c = *p++;
n <<= 8; n += c;
}
- n &= 0x7FFFFFFF;
return n;
}
@@ -258,7 +257,7 @@ code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
{
UChar *p = buf;
- if ((code & 0xff000000) != 0) *p++ = (UChar )(((code >> 24) | 0x80));
+ if ((code & 0xff000000) != 0) *p++ = (UChar )(((code >> 24) & 0xff));
if ((code & 0xff0000) != 0) *p++ = (UChar )(((code >> 16) & 0xff));
if ((code & 0xff00) != 0) *p++ = (UChar )(((code >> 8) & 0xff));
*p++ = (UChar )(code & 0xff);