diff options
| -rw-r--r-- | src/DBCS.h | 2 | ||||
| -rw-r--r-- | win32/ScintillaWin.cxx | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/DBCS.h b/src/DBCS.h index 96d282446..ccd71536a 100644 --- a/src/DBCS.h +++ b/src/DBCS.h @@ -37,7 +37,7 @@ constexpr uint16_t DBCSIndex(char ch1, char ch2) noexcept { } struct DBCSPair { - char chars[2]; + char chars[2]{}; }; using FoldMap = std::array<DBCSPair, 0x8000>; diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index fbec35f76..392e0b86c 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -2813,10 +2813,10 @@ void CreateFoldMap(int codePage, FoldMap *foldingMap) { if (DBCSIsLeadByte(codePage, ch1)) { for (unsigned char byte2 = highByteLast; byte2 >= minTrailByte; byte2--) { const char ch2 = byte2; + const DBCSPair pair{ ch1, ch2 }; + const uint16_t index = DBCSIndex(ch1, ch2); + (*foldingMap)[index] = pair; if (DBCSIsTrailByte(codePage, ch2)) { - const DBCSPair pair{ ch1, ch2 }; - const uint16_t index = DBCSIndex(ch1, ch2); - (*foldingMap)[index] = pair; const std::string_view svBytes(pair.chars, 2); const int lenUni = WideCharLenFromMultiByte(codePage, svBytes); if (lenUni == 1) { |
