From 7e5158aa97b1708c22478435ae69e26ec5c7f6ce Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Mon, 29 Apr 2019 16:54:49 +0000 Subject: mnemonics: fix 4 byte UTF-8 rewriting --- src/mnemonics/language_base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mnemonics/language_base.h b/src/mnemonics/language_base.h index 653314b04..7d2599e9a 100644 --- a/src/mnemonics/language_base.h +++ b/src/mnemonics/language_base.h @@ -129,7 +129,7 @@ namespace Language case 1: *wptr++ = cp; break; case 2: *wptr++ = 0xc0 | (cp >> 6); *wptr++ = 0x80 | (cp & 0x3f); break; case 3: *wptr++ = 0xe0 | (cp >> 12); *wptr++ = 0x80 | ((cp >> 6) & 0x3f); *wptr++ = 0x80 | (cp & 0x3f); break; - case 4: *wptr++ = 0xf0 | (cp >> 18); *wptr += 0x80 | ((cp >> 12) & 0x3f); *wptr++ = 0x80 | ((cp >> 6) & 0x3f); *wptr++ = 0x80 | (cp & 0x3f); break; + case 4: *wptr++ = 0xf0 | (cp >> 18); *wptr++ = 0x80 | ((cp >> 12) & 0x3f); *wptr++ = 0x80 | ((cp >> 6) & 0x3f); *wptr++ = 0x80 | (cp & 0x3f); break; default: throw std::runtime_error("Invalid UTF-8"); } *wptr = 0; -- cgit v1.2.3